If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Syntax error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-11, 10:17
18Dude88 18Dude88 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
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 & " ')"
Reply With Quote
  #2 (permalink)  
Old 12-08-11, 12:33
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 12-08-11, 14:25
robcarrol71 robcarrol71 is offline
Registered User
 
Join Date: Dec 2011
Posts: 7
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"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On