I have been trying to read data from a an Access query using ASP in vain. I realised eventually that i can read data from all queries EXCEPT if one of the fields in a query has a parameter like "Is Null" or "Is Not Null". I tried to change the parameter to be say WHERE CustomerName <> """" but i would get an error "too few parameters expected". On the contrary, if i set the parameter in query to be a number like WHERE Age > 25, the query runs OK and the response.write returns results.
Why is this so? Have you experienced it before? How do i get over this?
MICAH
Reply from Richard Rost:
Yes, I've run into this before. You can't reliably use parameters in queries in an Access database with ASP. You will run into this problem often. You need to structure your query without any parameters and then make your SQL statement in ASP perform the filtering with a WHERE clause. If your dataset is only pulling from one table, then use just that table for best results.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.