Incorrect syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mani19
    New Member
    • Jun 2007
    • 1

    Incorrect syntax

    Hello,
    I have added new DB columns(fields) in my SQl 2005 table .Problem comes when i update old data , one error come .

    Error Type:

    Microsoft OLE DB Provider for SQL Server (0x80040E14)
    Incorrect syntax near ','.

    when I added new data and update .it is working .

    Please tell me why my old data is not working with new DB columns(fields) .


    Thanks
    Mani
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    Your query statement (or update, depending on how you work it) is incorrect. Make the query statement and then print it to see how it looks before you send it to the db driver:
    [code=asp]query = "SELECT * FROM mytable WHERE idnum = "
    query = query & request("UID")
    response.write "<!-- query: " & query & " -->" & vbNewLine
    objRS.open query, objConn, adOpenDynamic, adLockOptimisti c[/code]What you will probably see is that some part of the query statement you thought was working is empty.

    Let me know if this helps.

    Jared

    Comment

    Working...