Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2007
    Posts
    214

    Question Unanswered: Insert into syntax error

    I get the famous INSERT INTO syntax error that I've researched and have found no solutions to. I don't appear to be using any common words. If someone can help me see what I'm missing in the code below, I'd appreciate it. Thanks!

    Const c_SQL As String = "INSERT INTO ClientData (clientname, division, location, office, parentnumber) VALUES ('@1','@2','@3','@4','@5',);"

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    There's an extra comma at the end of the parameters list:
    Code:
    Const c_SQL As String = "INSERT INTO ClientData (clientname, division, location, office, parentnumber) VALUES ('@1','@2','@3','@4','@5',);"
    Have a nice day!

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    These sort of errors are often more easily diagnosed if you look at the value of the variable, well constant in this case. Its all to easy to look at code and 'know' its right (well your eyes see the code, glaze over at the detail. Looking at the value always provides a check to see if what you have actually written matches what you think / know / believe your have written

    Whitespace (spaces) is free so id suggest spacing the values.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •