|
 |
access_asp thread: Re: Finding String Variables in SQL
Message #1 by "Zee Computer Consulting" <zee@t...> on Sun, 30 Sep 2001 19:00:18 -0700
|
|
Enclose the string in single quotes for the SQL statement:
' Single quote character
sq = chr(39)
' Build where clause
QueryWhere = "WHERE Initials = " & sq & strIDForChangedRecord & sq
-- Zee
----- Original Message -----
From: "Stephen Proctor" <steveproctor@c...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, September 30, 2001 9:42 PM
Subject: [access_asp] Finding String Variables in SQL
> I am having trouble finding strings using "=" rather than "LIKE" .
>
> Can this be done by, for example, one of the methods below?
>
> ....WHERE Initials=" strIDForChangedRecord
>
> ....WHERE Initials=" & strIDForChangedRecord
>
> Or can you only use LIKE to select string variables?
>
> Steve
>
Message #2 by "Jim Losi" <jlosi1@t...> on Sun, 30 Sep 2001 18:23:02 -0400
|
|
here is a sample of one of my SQL statements
SQL="SELECT variable FROM table Where variable='" &
Request.form("variable") &"' AND variable='"& Request.form("variable") &"' "
This example demostrates how to select from a database using a comparison of
data from a form to the database. I substituted the word "variable" for
where you would put your variables and the word "table" for where you would
put your table name.
good luck.
----- Original Message -----
From: "Stephen Proctor" <steveproctor@c...>
To: "Access ASP" <access_asp@p...>
Sent: Sunday, September 30, 2001 9:42 PM
Subject: [access_asp] Finding String Variables in SQL
> I am having trouble finding strings using "=" rather than "LIKE" .
>
> Can this be done by, for example, one of the methods below?
>
> ....WHERE Initials=" strIDForChangedRecord
>
> ....WHERE Initials=" & strIDForChangedRecord
>
> Or can you only use LIKE to select string variables?
>
> Steve
>
|
|
 |