Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 28058

Syntax error and passing duplicate parameter value

$
0
0

I am working on pre-existing code that someone else wrote and getting this error:

 <ERROR>
    Microsoft OLE DB Provider for SQL Server error '80040e14'

    Incorrect syntax near ','.

    /MyCoolPage.asp, line 40

  </ERROR>

I noticed when the page opens that its passing the ID used in the SQL query twice, ex:

  http://MyURL/MyCoolPage.asp?SID=22&CID=55&SID=22

and the code that builds the SQL is:

SID = Request("SID")
SQLStmt = "SELECT * FROM SomeTable WHERE SomeID = " & SID
SET RS = Connection.Execute(SQLStmt)

so the question that I have is this:  if you pass the same parameter and value twice in the URL will this put a comma in between values, exxample will it create a Select statement like this -- SELECT * FROM SomeTable where SomeID = 22,22

??

If anyone understands why this error is happening based on the information above please  let me know.

thanks

MC


Viewing all articles
Browse latest Browse all 28058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>