PDA

Click to See Complete Forum and Search --> : is tis possible?


MikeZ
Mar 20th, 2000, 09:45 PM
I am want to use a Input box to set the WHERE clause in a SQL statement I tried using for example:
strSQL="SELECT * from SHAPES WHERE color =Search$" but it will not recognise the value in Search$ is this possible or is there any easier way to do this .When I run in debug mode the Search$ contains the value I want but not when I add it to the sql

Mike

Glenn
Mar 20th, 2000, 10:19 PM
If Search$ is a variable in your application you need to try something like this:

strSQL="SELECT * from SHAPES WHERE color = '" & Search$ & "'"

Note the single quote characters surrounding the Search$ variable.

MikeZ
Mar 21st, 2000, 02:12 AM
Thanks Glenn I will give that a try what is the purpose of that & symbol before and after the string?

JHausmann
Mar 21st, 2000, 02:30 AM
String concatination operator.

MikeZ
Mar 21st, 2000, 10:31 PM
Many Thanks worked like a charm You saved me what little hair I have left