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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble using * (wildcard) when calling query from asp

Status
Not open for further replies.

jaredc

Programmer
Jun 28, 2002
43
GB
Hi

I've got a problem where I'm trying to make use of the * in an Access query which I'm calling from an asp using DSNless connection and attaching parameters to an ADO command object. The parameters are being passed in from a previous asp by means of the Querystring.

The actual problem I have is that when I test the query directly within Access and input * as the relevant parameter the query works fine, but when I try to call the same query from the asp supplying the * within a parameter as described above, Access seems to take the * character literally (as a value rather than the 'wildcard').

Thoughts which I've had are that the problem must be caused either when I'm calling the query form the asp (or in the way I'm calling the query) or maybe when I'm passing the * character in the Querystring from one page to another.

Any thoughts or advice regarding what I'm doing wrong or how I can put this right would be much appreciated. (I have thought of creating an additional query to call from the asp but would prefer to try and understand why this current method is not working)

PS I'm not sure whether I would be better posting this in the VBScript forum??
 
try changing to % symbol Bastien

There are many ways to skin this cat,
but it still tastes like chicken
 
Thanks for the advice Bastien, but I'm afraid is hasn't worked (no results are returned from the query even when trying it from within Access)

Perhaps I should add this to my previous description of the problem; When running the query within Access and supplying the '*' as a parameter, query results are returned (i.e. there is data in the recordset). However, when trying the same query from the asp the query appears to run ok (all objects created, connection established, etc.) but no results are returned, the recordset is empty. It appears that the query is looking for an '*' character in the database rather than treating the '*' as a wildcard.

I hope someone can help with this as it could save me creating loads of uneccessary queries in the database which are all doing roughly the same thing!
 
Bastien - I am an idiot! Changing the * to a % did in fact work (the reason it didn't get it working before was because I was passing the % character on the querystring which was causing me problems for some reason)

Thanks very much for your original advice,
Cheers
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top