Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Syntax Error in Select statement, requesting criteria from a form


Message #1 by "John Coutts" <jcoutts@p...> on Mon, 10 Feb 2003 17:50:05
I'm trying to set up a pw retrieval system for a portion of my website.  
The way everything is set up is that if a user attempts to log in with the 
correct email address but wrong password they then get the option to 
retrieve their password.  The form just asks for their email and "attempts 
to" compare it to values that are already stored in the database to send 
the user his/her pw via email.  I'm having trouble with the query statemtn 
to do this.

Here is the error I receive:

Microsoft JET Database Engine error '80040e14' 
Syntax error (missing operator) in query expression 'Email = 
jcoutts@p...'. 
/board/sendemail.asp, line 16 

Here is the code:
<!------Begin Code------------->
<%Response.Buffer=TRUE%>
<!--#include file="clssfd.asp"-->
<%


'here we are getting the info from the lost password form
dim uid
set uid = Request.Form("T1")

dim objcmd, rsbid
set objcmd = server.createobject("adodb.command")
set objcmd.activeconnection = objconn
strsql = "SELECT * FROM users WHERE Email = " & uid & ";"
objcmd.commandtype = adCmdText
objcmd.commandtext = strsql
set rsbid = objcmd.execute
<!----------------End Code------------------------>

If anyone could help me out I'd greatly appreciate it.

Thanks in advance.
John Coutts
Message #2 by imran.saleem@b... on Mon, 10 Feb 2003 17:43:07 -0000
try 
strsql = "SELECT * FROM users WHERE Email = '" & uid & "';"

-----Original Message-----
From: John Coutts [mailto:jcoutts@p...]
Sent: Monday, February 10, 2003 5:50 PM
To: ASP Databases
Subject: [asp_databases] Syntax Error in Select statement, requesting
criteria from a form


I'm trying to set up a pw retrieval system for a portion of my website.  
The way everything is set up is that if a user attempts to log in with the 
correct email address but wrong password they then get the option to 
retrieve their password.  The form just asks for their email and "attempts 
to" compare it to values that are already stored in the database to send 
the user his/her pw via email.  I'm having trouble with the query statemtn 
to do this.

Here is the error I receive:

Microsoft JET Database Engine error '80040e14' 
Syntax error (missing operator) in query expression 'Email = 
jcoutts@p...'. 
/board/sendemail.asp, line 16 

Here is the code:
<!------Begin Code------------->
<%Response.Buffer=TRUE%>
<!--#include file="clssfd.asp"-->
<%


'here we are getting the info from the lost password form
dim uid
set uid = Request.Form("T1")

dim objcmd, rsbid
set objcmd = server.createobject("adodb.command")
set objcmd.activeconnection = objconn
strsql = "SELECT * FROM users WHERE Email = " & uid & ";"
objcmd.commandtype = adCmdText
objcmd.commandtext = strsql
set rsbid = objcmd.execute
<!----------------End Code------------------------>

If anyone could help me out I'd greatly appreciate it.

Thanks in advance.
John Coutts
Message #3 by "Ken Schaefer" <ken@a...> on Tue, 11 Feb 2003 10:47:42 +1100
www.adopenstatic.com/faq/80040e14.asp

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "John Coutts" <jcoutts@p...>
Subject: [asp_databases] Syntax Error in Select statement, requesting
criteria from a form


: I'm trying to set up a pw retrieval system for a portion of my website.
: The way everything is set up is that if a user attempts to log in with the
: correct email address but wrong password they then get the option to
: retrieve their password.  The form just asks for their email and "attempts
: to" compare it to values that are already stored in the database to send
: the user his/her pw via email.  I'm having trouble with the query statemtn
: to do this.
:
: Here is the error I receive:
:
: Microsoft JET Database Engine error '80040e14'
: Syntax error (missing operator) in query expression 'Email 
: jcoutts@p...'.
: /board/sendemail.asp, line 16

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Return to Index