I'm trying to write some fields into a table in an Access DB and am having a problem.
My code is as follows:
For some reason it is failing on the "Field3" line with an error number -2147418105.Code:Dim cn As adodb.Connection Dim rs As adodb.Recordset Dim cString As String cString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=ABC.mdb;Persist Security Info=False;" Set cn = New adodb.Connection cn.Open cString Set rs = New adodb.Recordset With rs .Open "tbl_ABC", cn, adOpenKeyset, adLockOptimistic .AddNew .Fields("Field1").Value = "Test" .Fields("Field2").Value = Now() .Fields("Field3").Value = "abcdefghijklm.xls" .Update .Close End With
Can anyone help identify what I'm doing wrong ?
Thanks,




Reply With Quote