Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Query error


Message #1 by abel09@u... on Fri, 18 Oct 2002 10:47:54
Here is my query
strSQL="SELECT* FROM OpenTickets WHERE TicketID=" & Request("Ticket")
When I do response.write(strSQL)
          response.end
I only get the first part of the query ( SELECT * FROM OpenTickets WHERE 
TicketID =)
When I try to execute it in my ASP code I get the following error message, 
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'TicketID ='.

Could someone tell me what I'm doing wrong?
Message #2 by Colin.Montgomery@C... on Fri, 18 Oct 2002 10:49:33 +0100
is "Ticket" an integer?  Is it being passed by GET or POST?  If the answers
to these are YES and POST, your code should be:

strSQL = "SELECT * FROM OpenTickets " _
	& "WHERE TicketId =" _
	& Request.Forms("Ticket")

If "Ticket" is a string and you're using GET (the querystring):

strSQL = "SELECT * FROM OpenTickets " _
	& "WHERE TicketId ='" _
	& Request.Querystring("Ticket") _
	& "'"

Note i'm adding an extra single quote around the value of Ticket.

HTH,
Col


-----Original Message-----
From: abel09@u... [mailto:abel09@u...]
Sent: 18 October 2002 11:48
To: ASP Databases
Subject: [asp_databases] Query error


Here is my query
strSQL="SELECT* FROM OpenTickets WHERE TicketID=" & Request("Ticket")
When I do response.write(strSQL)
          response.end
I only get the first part of the query ( SELECT * FROM OpenTickets WHERE 
TicketID =)
When I try to execute it in my ASP code I get the following error message, 
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'TicketID ='.

Could someone tell me what I'm doing wrong?


*******

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure.  If you are not the
intended recipient, please telephone or email the sender and delete this message and any attachment from your system.  If you are
not the intended recipient you must not copy this message or attachment or disclose the contents to any other person.

For further information about Clifford Chance please see our website at http://www.cliffordchance.com or refer to any Clifford
Chance office.

Message #3 by "Drew, Ron" <RDrew@B...> on Fri, 18 Oct 2002 07:36:11 -0400
Request.Form  not Request.Forms  if POST

-----Original Message-----
From: Colin.Montgomery@C...
[mailto:Colin.Montgomery@C...]
Sent: Friday, October 18, 2002 5:50 AM
To: ASP Databases
Subject: [asp_databases] RE: Query error


is "Ticket" an integer?  Is it being passed by GET or POST?  If the
answers to these are YES and POST, your code should be:

strSQL =3D "SELECT * FROM OpenTickets " _
	& "WHERE TicketId =3D" _
	& Request.Forms("Ticket")

If "Ticket" is a string and you're using GET (the querystring):

strSQL =3D "SELECT * FROM OpenTickets " _
	& "WHERE TicketId =3D'" _
	& Request.Querystring("Ticket") _
	& "'"

Note i'm adding an extra single quote around the value of Ticket.

HTH,
Col


-----Original Message-----
From: abel09@u... [mailto:abel09@u...]
Sent: 18 October 2002 11:48
To: ASP Databases
Subject: [asp_databases] Query error


Here is my query
strSQL=3D"SELECT* FROM OpenTickets WHERE TicketID=3D" & 
Request("Ticket")
When I do response.write(strSQL)
          response.end
I only get the first part of the query ( SELECT * FROM OpenTickets WHERE

TicketID =3D)
When I try to execute it in my ASP code I get the following error
message,
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'TicketID =3D'.

Could someone tell me what I'm doing wrong?


*******

This message and any attachment are confidential and may be privileged
or otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment from your system.  If you are not the intended
recipient you must not copy this message or attachment or disclose the
contents to any other person.

For further information about Clifford Chance please see our website at
http://www.cliffordchance.com or refer to any Clifford Chance office.



  Return to Index