Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp and SQL problem

Status
Not open for further replies.

Glutus

Programmer
Jul 13, 2001
27
SE
I am trying to use a WHERE statement to remove all items with a number lower than something, for example:

<%
NoItems=3

set dba = server.createobject(&quot;ADODB.Connection&quot;)
dba.open &quot;DRIVER={Microsoft Access Driver *.mdb)};DBQ=C:\Database.mdb&quot;

set db=dba.Execute(&quot;SELECT * FROM Database WHERE ItemCount<&quot; & NoItems&quot;)
%>

When I run it, I get the message:
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Analysis Class<3'

What the heck is the problem? I'm sure it's a silly little mistake, but it's driving me nuts. Please, help me!
 
Hi Glutus,

It seems that you get 3 double quotes in your sample.

set db=dba.Execute(&quot;SELECT * FROM Database WHERE ItemCount<&quot; & NoItems&quot;)

Hope this helps...
 
Sorry it should read:

set db=dba.Execute(&quot;SELECT * FROM Database WHERE ItemCount<&quot; & NoItems)
 
The NoItems items is numerical and the Items column as well.
 
I used this and didn't have a problem.

objConn.Execute(&quot;SELECT * FROM webdata WHERE id <&quot; &NoItems)
 
I found the error and it was silly. I was pointing to an old database, so the SQL couldn't find the column. Thank you for your input and time. I'll try to help you sometime.
 
No problem, it happens to us all

&quot;Can't see the wood for tree's&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top