Print Page | Close Window

SQL string help

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3741
Printed Date: 29 March 2026 at 11:56pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL string help
Posted By: Mart
Subject: SQL string help
Date Posted: 22 June 2003 at 9:38am

Could someone please tell me what is wrong with this:

SQL="SELECT * FROM tblLogin WHERE ID='" & request.cookies("login") & "';"

Its probabley really simple becuse if you use SQL="SELECT * FROM tblLogin;" it works.

Thanks, mart.

Ps this is the error I get

Microsoft OLE DB Provider for ODBC Drivers error '80040e07'

[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.

/db/user.asp, line 13




Replies:
Posted By: michael
Date Posted: 22 June 2003 at 1:56pm
Loose the single quotes (') as integer values do not require them. (I suppose your id field is a number or autonumber fields

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Mart
Date Posted: 22 June 2003 at 2:01pm

Thanks for that, I tried it but now I get this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID='.

/db/user.asp, line 13

(Id is a autonumber)

Thanks, Martin.



Posted By: ljamal
Date Posted: 22 June 2003 at 2:14pm
That means that there is nothing stored in the cookie value you are requesting

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: Mart
Date Posted: 22 June 2003 at 2:18pm

Thanks for that ljamal, I have made it check for a null cookie now.

Mart.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net