genne
05-12-2011, 09:48 PM
Hi,
I am new to this and have almost 0 programming knowledge. I want to automate transferring data from excel spreadsheet to access. i surfed around on the net to see if there were examples of codes that i can copy. this is what i currently have.
Dim connectionString As String
Set con = New ADODB.Connection
con.connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "\\Ixisibm\Investments\Genevie\Testing.mdb"
con.Open
Set rs = New ADODB.Recordset
With rs
.Open "Table_Test", cn, adopenkeysey, adLockPessimistic, adCmdTable
.AddNew ' create a new record
' add values to each field in the record
.Fields.........
.UPDATE ' stores the new record
End With
rs.Close
Set rs = Nothing
i think the error is at con.Open. I get a Run-time error '-2147467259(80004005)'.
Thanks so much in advance for your help!
I am new to this and have almost 0 programming knowledge. I want to automate transferring data from excel spreadsheet to access. i surfed around on the net to see if there were examples of codes that i can copy. this is what i currently have.
Dim connectionString As String
Set con = New ADODB.Connection
con.connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & "\\Ixisibm\Investments\Genevie\Testing.mdb"
con.Open
Set rs = New ADODB.Recordset
With rs
.Open "Table_Test", cn, adopenkeysey, adLockPessimistic, adCmdTable
.AddNew ' create a new record
' add values to each field in the record
.Fields.........
.UPDATE ' stores the new record
End With
rs.Close
Set rs = Nothing
i think the error is at con.Open. I get a Run-time error '-2147467259(80004005)'.
Thanks so much in advance for your help!