' Create the Connection and Recordset objects.
Set conn = New ADODB.Connection
Set rs = New ADODB.Recordset
Dim val As String
val = Range("B5").Value
' Open the connection and execute.
conn.Open sConnString
Dim item As String
item = "INSERT INTO [IndustrialComp].[dbo].[Header]("
item = item & " [server_name] "
item = item & " )Values("
item = item & " '" & val & "')"
conn.Execute item
The above code inserts whatever vale is in B5 into a sql server 08 databse (industcomp) a table called header and a collumn named server_name.
I bascially want insert multiple values into this database..the three collumns are server_name, phys and virt.
e.g b5 insert into server_name....c5 insert into phys...d5 insert into virt.
Would I need to declare multiple strings or is there a way to basically list the values against the corrisponding collumns?
Thanks