Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Insert Stement for SQLServer
I have data as follows on EXCEL:
ColA ColB MARC 123 marc1234 234 marc1235 555/0 I have a SQL table with the same structure. I want to insert the range. I tried: Dim cName1, cName2 As Variant cName1 = Range("A") cName2 = Range("B") sq = "Insert into marc_temp_excel (ColA, ColB) values (cName1, cName2)" Set r = c.Execute(sq) c.Close MsgBox ("marc_temp_excel Table Successfully Updated.") End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA Insert Stement for SQLServer
got iot but have a syntax error as in 'VBA Syntax' thread above.
"marcmc" wrote: I have data as follows on EXCEL: ColA ColB MARC 123 marc1234 234 marc1235 555/0 I have a SQL table with the same structure. I want to insert the range. I tried: Dim cName1, cName2 As Variant cName1 = Range("A") cName2 = Range("B") sq = "Insert into marc_temp_excel (ColA, ColB) values (cName1, cName2)" Set r = c.Execute(sq) c.Close MsgBox ("marc_temp_excel Table Successfully Updated.") End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel - MS sqlserver 2000 connection | Excel Discussion (Misc queries) | |||
ADODB from SQLServer - IF function? | Excel Programming | |||
Excel Front End , SqlServer Backend in the web | Excel Programming |