Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Using SQL statement with RecordSet object


Message #1 by "patrick" <poh@v...> on Wed, 15 Nov 2000 18:17:53 -0000
Hi,



The code below returns the following error,

"Syntax error (missing operator) in query expression 'Email

=poh@v...'. "



set objRS = Server.CreateObject ("ADODB.Recordset")

objRS.Open "SELECT * FROM tblUser WHERE Email =" & strEmail, _

   strConnect, adOpenForwardOnly, adLockReadOnly, adCmdtext



My guess is that when I use the WHERE statement to limit with a string you

need to use a single quotes around the string.  For example - the SQL

statement should look like: WHERE Email = 'strEmail'  However, how does

one pass single quotes around a string variable?



Any suggestions would help.

thanks in advance.

Message #2 by "patrick" <poh@v...> on Wed, 15 Nov 2000 21:06:20 -0000
Nevermind, I figure this out from a previous post.



thanks anyway.


  Return to Index