Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Syntax error(missing operator)


Message #1 by "Harjit Singh Grewal" <hsgrewal@g...> on Sun, 18 Feb 2001 14:04:13 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_0009_01C099B3.AC794BC0

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



I have been bogged down by this problem for last one week and 'm unable 

to solve it. My problem is that while executing a query I'm getting an 

error:



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



[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing 

operator) in query expression 'sessionid =3D'.



bottom.asp, line 9



The code for my page is:





<%@ Language=3DVBScript %>

<%

idnumber =3D request.form("idtracker")



set objconn =3D Server.CreateObject("ADODB.Connection")

strconn=3D"Driver=3D{Microsoft Access Driver (*.mdb)};DBQ=3D" & 

server.mappath("data.mdb")

objconn.Open strconn



 sql_check =3D "select * from chattable where sessionid =3D " & idnumber 



 Set objrs =3D objconn.execute(sql_check)



  if not objrs.eof then

  nome =3D objrs("name")

  end if

%>








Message #2 by "JOHN P. PARLATO" <jparlato@m...> on Sun, 18 Feb 2001 08:54:28 -0800
Do a response.write of your sql to see what the4 value of sessionid is ????



Then lets talk.
Message #3 by Imar Spaanjaars <Imar@S...> on Sun, 18 Feb 2001 17:29:15 +0100
It sounds like idnumber does not have a value. Is the Form element called 

idtracker? No typos? You can't run a SELECT with a where clause that 

doesn't have a value, so the error mentioned will be thrown.



Always (as in ALWAYS ;-)) do a response.write( sql_check) before you 

execute a query. That way you can see what you're doing, and what goes wrong.



sql_check = "select * from chattable where sessionid = " & idnumber

Response.Write(sql_check)

Set objrs = objconn.execute(sql_check)



Hope this helps,



Imar







At 02:04 PM 2/18/2001 +0530, you wrote:

>I have been bogged down by this problem for last one week and 'm unable to 

>solve it. My problem is that while executing a query I'm getting an error:

>

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

>

>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) 

>in query expression 'sessionid ='.

>

>bottom.asp, line 9

>

>The code for my page is:

>

>

><%@ Language=VBScript %>

><%

>idnumber = request.form("idtracker")

>

>set objconn = Server.CreateObject("ADODB.Connection")

>strconn="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & 

>server.mappath("data.mdb")

>objconn.Open strconn

>

>  sql_check = "select * from chattable where sessionid = " & idnumber

>  Set objrs = objconn.execute(sql_check)

>

>   if not objrs.eof then

>   nome = objrs("name")

>   end if

>%>



Message #4 by "Ken Schaefer" <ken@a...> on Mon, 19 Feb 2001 17:02:06 +1100
http://www.adopenstatic.com/faq/80040e14.asp



Cheers

Ken



----- Original Message -----

From: "Harjit Singh Grewal" <hsgrewal@g...>

To: "ASP Databases" <asp_databases@p...>

Sent: Sunday, February 18, 2001 7:34 PM

Subject: [asp_databases] Syntax error(missing operator)





I have been bogged down by this problem for last one week and 'm unable to

solve it. My problem is that while executing a query I'm getting an error:



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



Message #5 by philip.moh@a... on Mon, 19 Feb 2001 10:19:15 +0800
change you SQL statement:



sql_check = "select * from chattable where sessionid = '" & idnumber & "'"



--

Phil



> -----Original Message-----

> From:	Harjit Singh Grewal [SMTP:hsgrewal@g...]

> Sent:	Sunday, February 18, 2001 4:34 PM

> To:	ASP Databases

> Subject:	[asp_databases] Syntax error(missing operator)

> 

> I have been bogged down by this problem for last one week and 'm unable to

> solve it. My problem is that while executing a query I'm getting an error:

>  

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

>  

> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)

> in query expression 'sessionid ='. 

>  

> bottom.asp, line 9 

>  

> The code for my page is:

>  

> 

> <%@ Language=VBScript %>

> <%

> idnumber = request.form("idtracker")

>  

> set objconn = Server.CreateObject("ADODB.Connection")

> strconn="Driver={Microsoft Access Driver (*.mdb)};DBQ=" &

> server.mappath("data.mdb")

> objconn.Open strconn

>  

>  sql_check = "select * from chattable where sessionid = " & idnumber  

>  Set objrs = objconn.execute(sql_check) 

>  

>   if not objrs.eof then

>   nome = objrs("name")

>   end if

> %>

> 

> 

> ---

> Please take a moment to tell us how you are using AuthentiX, WebQuota, and

> VideoQuota

> 

> http://www.flicks.com/feedback/feed.asp

> 

> Scott Gordon

> Marketing

> Flicks Software

> www.flicks.com

>  xxx-xxx-xxxx

> 
Message #6 by Ben Greenhouse <b.greenhouse@u...> on Sun, 18 Feb 2001 19:11:03 -0500
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

<html>

<body bgcolor="#FFFFFF">

Try putting idnumber in single quotes (e.g. <b><font face="Arial"><font color="#800080"><font
size=-1>sessionid

= '" & idnumber & "'")</font></font></font></b><b><font face="Arial"><font
color="#800080"><font size=-1></font></font></font></b>

<p><b><font face="Arial"><font color="#800080"><font size=-1>I sometimes

got problems from that, and I think they might have been like
this.</font></font></font></b><b><font face="Arial"><font color="#800080"><font
size=-1></font></font></font></b>

<p><b><font face="Arial"><font color="#800080"><font
size=-1>Ben</font></font></font></b>

<p>Harjit Singh Grewal wrote:

<blockquote TYPE=CITE><style></style>

<font face="Arial"><font size=-1>I

have been bogged down by this problem for last one week and 'm unable to

solve it. My problem is that while executing a query I'm getting an error:</font></font> <b><font
face="Arial"><font color="#0000FF"><font size=-1>Microsoft

OLE DB Provider for ODBC Drivers error '80040e14'</font></font></font></b> <b><font
face="Arial"><font color="#0000FF"><font size=-1>[Microsoft][ODBC

Microsoft Access Driver] Syntax error (missing operator) in query expression

'sessionid ='.</font></font></font></b> <b><font face="Arial"><font
color="#0000FF"><font size=-1>bottom.asp,

line 9</font></font></font></b><font face="Arial"><font size=-1>The code

for my page is:</font></font>  

<br><b><font face="Arial"><font color="#800080"><font size=-1><%@ Language=VBScript

%></font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font
size=-1><%</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1>idnumber

= request.form("idtracker")</font></font></font></b> <b><font face="Arial"><font
color="#800080"><font size=-1>set

objconn = Server.CreateObject("ADODB.Connection")</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1>strconn="Driver={Microsoft

Access Driver (*.mdb)};DBQ=" & server.mappath("data.mdb")</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1>objconn.Open

strconn</font></font></font></b> <b><font face="Arial"><font color="#800080"><font
size=-1> sql_check

= "select * from chattable where sessionid = " & idnumber</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1> Set

objrs = objconn.execute(sql_check)</font></font></font></b> <b><font face="Arial"><font
color="#800080"><font size=-1> 

if not objrs.eof then</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1>  nome

= objrs("name")</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font size=-1>  end

if</font></font></font></b>

<br><b><font face="Arial"><font color="#800080"><font
size=-1>%></font></font></font></b>

<p><br></blockquote>



</body>

</html>



Message #7 by "Wally Burfine" <oopconsultant@h...> on Mon, 19 Feb 2001 04:48:19 -0000
Looks like idnumber is empty. Check it out using response.write "Id#: " & 

idnumber & "<BR>" before you create the connection.



>From: "Harjit Singh Grewal" <hsgrewal@g...>

>Reply-To: "ASP Databases" <asp_databases@p...>

>To: "ASP Databases" <asp_databases@p...>

>Subject: [asp_databases] Syntax error(missing operator)

>Date: Sun, 18 Feb 2001 14:04:13 +0530

>

>I have been bogged down by this problem for last one week and 'm unable to 

>solve it. My problem is that while executing a query I'm getting an error:

>

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

>

>[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) 

>in query expression 'sessionid ='.

>

>bottom.asp, line 9

>

>The code for my page is:

>

>

><%@ Language=VBScript %>

><%

>idnumber = request.form("idtracker")

>

>set objconn = Server.CreateObject("ADODB.Connection")

>strconn="Driver={Microsoft Access Driver (*.mdb)};DBQ=" & 

>server.mappath("data.mdb")

>objconn.Open strconn

>

>  sql_check = "select * from chattable where sessionid = " & idnumber

>  Set objrs = objconn.execute(sql_check)

>

>   if not objrs.eof then

>   nome = objrs("name")

>   end if

>%>

>

>

>

>

>
Message #8 by "Harjit Singh Grewal" <hsgrewal@g...> on Mon, 19 Feb 2001 16:07:13 +0530
This is a multi-part message in MIME format.



------=_NextPart_000_0011_01C09A8E.05D12500

Content-Type: text/plain;

	charset="iso-8859-1"

Content-Transfer-Encoding: quoted-printable



Thanks for your help but I have found the error, the error was while I 

populated the field in the form it wasn't populated properly an "=3D" 

was missing there.

Thanks any way to all of you.

Harjit

  ----- Original Message -----

  From: Ben Greenhouse

  To: ASP Databases

  Sent: Monday, February 19, 2001 5:41 AM

  Subject: [asp_databases] Re: Syntax error(missing operator)





  Try putting idnumber in single quotes (e.g. sessionid =3D '" & 

idnumber & "'")

  I sometimes got problems from that, and I think they might have been 

like this.



  Ben



  Harjit Singh Grewal wrote:



    I have been bogged down by this problem for last one week and 'm 

unable to solve it. My problem is that while executing a query I'm 

getting an error: Microsoft OLE DB Provider for ODBC Drivers error 

'80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error 

(missing operator) in query expression 'sessionid =3D'. bottom.asp, line 

9The code for my page is:  

    <%@ Language=3DVBScript %>

    <%

    idnumber =3D request.form("idtracker") set objconn =3D 

Server.CreateObject("ADODB.Connection")

    strconn=3D"Driver=3D{Microsoft Access Driver (*.mdb)};DBQ=3D" & 

server.mappath("data.mdb")

    objconn.Open strconn  sql_check =3D "select * from chattable where 

sessionid =3D " & idnumber

     Set objrs =3D objconn.execute(sql_check)   if not objrs.eof then

      nome =3D objrs("name")

      end if

    %>









  ---

  Please take a moment to tell us how you are using AuthentiX, WebQuota, 

and

  VideoQuota



  http://www.flicks.com/feedback/feed.asp



  Scott Gordon

  Marketing

  Flicks Software

  www.flicks.com

   xxx-xxx-xxxx



hsgrewal@g...


$subst('Email.Unsub')







  Return to Index