syntax error (comma) with quoted field

presuming_ed

Registered User.
Local time
Today, 02:03
Joined
May 6, 2003
Messages
23
I'm running the following code to insert a record into a table:

db.Execute "INSERT INTO email_this " _
& "(f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21) VALUES " _
& "('" & t_f1 & "', '" & t_f2 & "', '" & t_f3 & "', '" & t_f4 & "', '" & t_f5 & "'," _
& "('" & t_f6 & "', '" & t_f7 & "', '" & t_f8 & "', '" & t_f9 & "', '" & t_f10 & "'," _
& "('" & t_f11 & "', '" & t_f12 & "', '" & t_f13 & "', '" & t_f14 & "', '" & t_f15 & "'," _
& "('" & t_f16 & "', '" & t_f17 & "', '" & t_f18 & "', '" & t_f19 & "', '" & t_f20 & "'," _
& "('" & t_f21 & "');"

however, some of the values (quoted fields) I'm inserting contain commas i.e t_f1 = "44,3233.09", and this is giving me a syntax error (comma) when I run the code. I can't work out how to code around this. Can anyone help please?
 
I think it is the 4 extra & "('" in the VALUES string that have caused the problem, not the comma in "44,3233.09"
 
EMP,

You're absolutely right! Sorry for being so dim.... I couldn't see the error for looking!

Thanks.
 

Users who are viewing this thread

Back
Top Bottom