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

Using ASP to query mysql using the select like is flawed?

Status
Not open for further replies.
Feb 16, 2001
3
0
0
US
IIS 5.0 / MySQL v3.23.47
I have the following in an asp page on our Intranet:

SELECT * FROM photofile WHERE (LastName Like '%" & keyword & "%') order by LastName asc

With "keyword" being the name of the form field being posted.

This works 99.9% of the time. My users have found a couple of instances where it will not return the name(s) searched for.

Simpson does not work
Sim does work
pson does work
Simp does not work
imp does not work
Zito does not work
Z does work
Zi does work
Zit does not work
ito does not work

"i" seems to be the common denominator. If I do the same queries from mysql they all work correctly.

Any assistance/ideas would be GREATLY appreciated!
 
Double check that you are doing a MoveFirst on your recordset before outputting. I have not seen this error before and the only thing I can think of off the top of my head is that the recordset pointer is not pointing to the top record before you start outputting the results. this will occasionally happen when you order by in an sql statement, as the pointer in some dbs is set before the order occurs, leaving it somewhere in the middle of the recordset when you start to manipulate it.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top