Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another one of those SQL syntax error

Status
Not open for further replies.

csiwa28

Programmer
Apr 12, 2001
177
I'm getting an improper usage at my SQL statement and I don't know why. The variable "Name" is created from a query string from a previous asp page. Thanks to anyone that can help me.


SQL_query = "SELECT Product_comCompanyID FROM Products WHERE ProductTypeID =" & Request.QueryString("Name")

Set oRS = oConn.Execute(SQL_query)
 
Is Request.QueryString("Name") an integer or string? Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 


csiwa28,

If your Request.QueryString("Name") has a space in it you will need to enclose your query with single quotes.

SQL_query = "SELECT Product_comCompanyID FROM Products WHERE ProductTypeID ='" & Request.QueryString("Name") & "'"


Cheers,
fengshui1998





 
What's exactly is in the NAME?
Give us the EXACT content of it, so we can help u more.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top