 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 15th, 2004, 09:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Can I know about what was done to get that work atlast?
_________________________
- Vijay G
Strive for Perfection
|
|

July 15th, 2004, 09:35 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
This works:
dim cn, sql, rs
cn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\inetpub\database\ftp.mdb"
set rs = server.createobject("adodb.recordset")
sql = "select [Password] from [Password] where [Password] = 'pillow'"
rs.open sql, cn
if not rs.eof then
do while not rs.eof
response.write rs("Password") & "<br>"
rs.movenext
loop
end if
rs.close
set rs = nothing
Another question though, whats the syntax for short date in access? On my database things are formated like so: 9/11/00 but when I do
sql = "select [Assigned] from [Password] where [Assigned] = '9/11/00'"
it says that there is a data type mismatch in the criteria field. I've tried all variations I can think of. 09/11/00, 09/11/2000, 091100, 09112000 etc. Thanks.
|
|

July 15th, 2004, 09:48 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Try this
select format("9/11/00","yyyy-mm-dd")
Select format([Assigned],"yyyy-mm-dd") from [Password];
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 15th, 2004, 10:07 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error Type:
Microsoft VBScript compilation (0x800A03FD)
Expected 'Case'
/adamstuff/test.asp, line 52, column 7
Basically here's what I need to do in total. I need to scan my database starting in the Password table. If Assigned is today and IsCurrent is true it needs to get the password in the Password field and also the ID. Then it needs to go into the CLIENT table and using the ID get the CLIENT NAME data for the id. Then it also needs to go into the CLIENT_CONTACTS table and get the CONTACT NAME and CONTACT EMAIL using the matching id. There will be multiple names and multiple emails for each ID but everything else will only be one. Then I need to group by Company/ID and display the data. If you wanna help with that as well. :D
|
|

July 15th, 2004, 10:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
That error says case is missing. With such few details I am not sure what and where you are going wrong, and it is too difficult to suggest anything on that.
As per the error, it looks that you are missing a CASE statement going wrong with the syntax with CASE.
May be once you get done with PASSWORD table, using its ID you got to write SELECT statement that uses a join with all the other related tables to pull the info. Still that doesn't seem to be in detail. May be you can try that at your end and post as and when you see errors. And I may suggest you if you go wrong logically too. Hope that makes sense.
PS: I would be around for another hour or so.;)
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 15th, 2004, 10:20 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I posted that error cause I'm getting it from your two lines of code you stated.
select format("9/11/00","yyyy-mm-dd")
Select format([Assigned],"yyyy-mm-dd") from [Password];
I didn't know if there should be a case for this..and if so what it was.
|
|

July 15th, 2004, 10:33 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Those are just example SELECT Statements for you to extract the date in right format. You can test that in access DB and see if you are getting the right values.
I think you are doing a COPY PASTE into your ASP page. That way it won't work.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

July 15th, 2004, 12:42 PM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Oh, hehe, I feel silly. I just copied that. I'll test in a database. Thanks. :D
|
|
 |