If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Syntax error (missing operator)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-05, 01:21
MrLance MrLance is offline
Registered User
 
Join Date: Nov 2005
Posts: 1
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
Reply With Quote
  #2 (permalink)  
Old 11-20-05, 00:31
fredservillon fredservillon is offline
Registered User
 
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") & "'"
Reply With Quote
  #3 (permalink)  
Old 11-20-05, 17:21
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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.
Reply With Quote
  #4 (permalink)  
Old 11-24-05, 02:58
Bullschmidt Bullschmidt is offline
Guru
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On