Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    1

    Unanswered: Syntax error (missing operator)

    Hello,

    I am getting the error below:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'AreaID='.

    /membership/o12register.asp, line 20


    Here is the code up to line 20

    Code:
    <!--#include file="dsn.asp"-->
    <!--#include file="func.asp"-->
    <%
    If request("Page") = "2" Then
    
    	SQL = "SELECT * FROM Users WHERE Username='" & request("Username") & "'"
    	Set RS = Server.CreateObject("ADODB.Recordset")
    	RS.Open SQL, Conn, 1, 3
    	
    	If NOT (RS.BOF AND RS.EOF) Then
    		Response.redirect "o12register.asp?Username=" & request("Username") & "&Name=" & request("Name") & "&Email=" & request("Email") & "&Error=Username&AreaID=" & request("AreaID")
    	End If
    	
    	RS.Close
    	Set RS = Nothing
    	
    	
    	SQL = "SELECT * FROM Areas WHERE AreaID=" & request("AreaID")
    	Set RS = Server.CreateObject("ADODB.Recordset")
    	RS.Open SQL, Conn, 1, 3

    Any suggestions on what could be the problem? Thank you for any help you can give me.

    Lance

  2. #2
    Join Date
    Oct 2005
    Posts
    178
    Quote Originally Posted by MrLance
    Hello,

    I am getting the error below:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'AreaID='.

    /membership/o12register.asp, line 20


    Here is the code up to line 20

    Code:
    <!--#include file="dsn.asp"-->
    <!--#include file="func.asp"-->
    <%
    If request("Page") = "2" Then
    
    	SQL = "SELECT * FROM Users WHERE Username='" & request("Username") & "'"
    	Set RS = Server.CreateObject("ADODB.Recordset")
    	RS.Open SQL, Conn, 1, 3
    	
    	If NOT (RS.BOF AND RS.EOF) Then
    		Response.redirect "o12register.asp?Username=" & request("Username") & "&Name=" & request("Name") & "&Email=" & request("Email") & "&Error=Username&AreaID=" & request("AreaID")
    	End If
    	
    	RS.Close
    	Set RS = Nothing
    	
    	
    	SQL = "SELECT * FROM Areas WHERE AreaID=" & request("AreaID")
    	Set RS = Server.CreateObject("ADODB.Recordset")
    	RS.Open SQL, Conn, 1, 3

    Any suggestions on what could be the problem? Thank you for any help you can give me.

    Lance
    If AreaID is a String var then

    SQL = "SELECT * FROM Areas WHERE AreaID='" & request("AreaID") & "'"

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    I suspect you have a typo in your submitting page.... eg that AreaID is actually being sent as AreaId or something.

    If you change it to this you will see what the sql statement that you are trying to send to the database.
    Code:
    SQL = "SELECT * FROM Areas WHERE AreaID=" & request("AreaID")
    Request.Write SQL
    I suspect you will see

    SELECT * FROM Areas WHERE AreaID=

    Which indicates that AreaID can not be found in the request object.

  4. #4
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    And for a related link:

    Why do I get 80040E14 errors?
    http://www.aspfaq.com/show.asp?id=2400
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •