Hi, i'm trying to pass SQL code to an access db, the access db has the multiple entry in a single collum option active, i.e. country (France, Uk, Ireland) rather than using relations ect... my question is how do i pass sql code to record data into it
my code
happily grabs the data, but then wont let me re enter it... really anoyingrst.Open "Select * From Feed", conn Sheets("Feeds").Range("A2").CopyFromRecordset rst
my code to re enter is
vtSql = "" vtSql = vtSql & " INSERT INTO Feeds (ID, Start Date, Stop Date, Languages, Countries, Advertising, Region, Transmission Costs)" vtSql = vtSql & " VALUES (" & R & ", " & Range("B" & R).Value & ", " & Range("C" & R).Value & ", " & Range("D" & R).Value & ", " & Range("E" & R).Value & ", " & Range("F" & R).Value & ", " & Range("G" & R).Value & ", " & Range("H" & R).Value & ", " & Range("I" & R).Value & ")" conn.Execute vtSql
any suggestions?
Last edited by Jollyfrog; 09-28-2010 at 10:41 AM. Reason: code update
If your field names contain spaces, you should include them in square brackets. You also need to enclose any text data you are passing in single quotes.
Ah thanks, i now get INSTERT ITNO query cannot contain multi valued field
how do i get round this?
thanks
Jonathan
I don't know offhand. Multi-value fields pretty much violate every database principle, so I never use them.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks