MySQL Forums
Forum List  »  MySQL for Visual Studio

Re: ASP: Select statement problem
Posted by: Francisco Alberto Tirado Zavala
Date: December 03, 2014 04:30PM

Hello C Murray.

The error is thrown because when you concatenate the input from the textbox to the query the text from the input has no quotes or singles quotes. So when the query is executes the server takes [birds] as a column because it has no quotes, the query doesn't fails with a numeric value because a number is a valid value for the INSTR function.

For a quick fix you can add single quotes to the query, one after the comma inside the function call and the other before the closing parenthesis of the function:
"select * from inventory where instr(description,'" & kwStr &"')>0"

Thanks for your time.

*** My opinions do not necessarily reflect the opinions of my employeer ***
MySql Windows Experience Team

Options: ReplyQuote

Written By
December 03, 2014 12:38AM
Re: ASP: Select statement problem
December 03, 2014 04:30PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.