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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incorrect syntax near '*'

Status
Not open for further replies.

ITGL72

MIS
Joined
Jul 2, 2001
Messages
105
Location
US
Hopefully someone has seen this before and can point me in the right direction. The error I am getting is below:

Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)


[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '*'.


Data Source = "XXXXXX"


The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (6:1) to (6:48).

Well position (6:1) to (6:48) is basically looking like this:

<CFQUERY NAME=&quot;DETAILER&quot; DATASOURCE=&quot;XXXXX&quot;>
SELECT *
FROM AGENTSEO
WHERE ID = '#URL.ID#'
</CFQUERY>




Now, to me, that code doesn't look wrong. I'm no CF programming guru but the above code doesn't look to me to have any error but its not working and giving me the error listed above.


When I go to the web page that uses this code (I have about 11 records in the DB right now) clicking on anything that brings up the page with that above code gives me the error. But not for every record. Some records come up fine, like 2 of them. Anyway lets start off with if anyone knows or has seen that error before and what I should look into to correct it. Much thanks!


 
Have not seen this exact error before, but sometimes the literal error message returned isn't really the problem. Let me suggest a few things. In order to truly isolate whether the source of the error is the '*&quot; syntax, I would suggest replacing it with a comma delimited list of all the fields you want. If the problem goes away, then you know that the error was with the '*' syntax. This should not normally throw an error. I would consider re-installing the ODBC driver, and re-examining what database software you are using. If the error persist, then it is obvioous that it is not the '*' syntax. It could be the ID field. Is your ID field really a character datatype? If its numeric, you don't need the quotes around #url.id#. This could cause a data type mismatch error. If this isn't the source of the problem, I would consider switching database drivers.
 
Its a SQL server DB - I rebooted the web server and the darn thing started working fine again. I don't get it. But it works now. Something got confused in there.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top