Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel to Access SQL problem
Hi, I am trying to use a SQL string using INSERT INTO to populate a table in
Access. This works fine for all text based columns but returns a runtime error for columns with numbers. I have tried omitting thew single quotes but am still having no luck. Can someone help..please. The code I'm using is below; ReDim myfield1(LBound(myfield1) To UBound(myfield1), 1 To 4) For x = LBound(myfield1) To UBound(myfield1) For y = 1 To 4 myfield1(x, y) = mysheet.Cells(x + 1, y).Value Next y mysql = "INSERT INTO Backups(Client,Policy,Schedule,Media) " mysql = mysql + "VALUES ('" & myfield1(x, 1) & "','" & myfield1(x, 2) & "','" & myfield1(x, 3) & _ "','" & myfield1(x, 4) & "') " command.CommandText = mysql MsgBox mysql command.Execute |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Access to Excel problem | Excel Discussion (Misc queries) | |||
Excel to Access Problem | Excel Discussion (Misc queries) | |||
Started out as an Access problem. Now an Excel problem | Excel Discussion (Misc queries) | |||
Access to Excel problem? | Excel Discussion (Misc queries) | |||
excel to access problem | Excel Discussion (Misc queries) |