Results 1 to 3 of 3

Thread: Syntax error

  1. #1
    Join Date
    Nov 2011

    Unanswered: Syntax error

    I getting an error saying that there is a syntax error in the inser into, dont know where it is?

    I'm using SQl within Access VBA

    SQLstring = "INSERT INTO Reason_Code_Access(Reason_Code, Group, Full_Description) VALUES " & _
    "(' " & ReasonCodeVar & " ' , ' " & GroupUploadVar & " ' , ' " & DescriptionUploadVar & " ')"

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    on the face of it that looks OK
    is this error a MySQL syntax error or a PHP error?
    if PHP.... is there a semi colon terminating each line of code
    bear in mind also with PHP the reported line is the line PHP failed on, the line with the error may be the line above.

    if SQL
    what does the actual SQL look like, the SQL being sent to the engine
    are any of those values numeric, if so they should not be encapsulated with quote marks
    minor point there's no terminating semicolon at the end fo the SQL< although some SQL engines are happy with that.
    also there is no space between the table name and the bracket with the column names, agaion I doubt its actusally the problem, but if all else fails.....
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2011
    Perhaps the issue is "Group" in your field list? Try `Group` with backticks. MySQL might not like "Group" without the backticks because "Group" is used by "GROUP BY"

Posting Permissions

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