Open Access file using VBA in Excel gives 2147467259 error

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!

Orca44
05-15-2011, 07:18 AM
Was there any description included with the error?

From this (http://support.microsoft.com/kb/168336) MSDN page I would assume that the error number
indicates that the file could not be found or accessed, since that is what the examples indicate, but that is a fairly
big assumption, it could mean something else. Still it is definitely something to look into.

Is it possible to test the application where the .mdb file is located on a local path?
Are you sure that the .mdb file is located at specified path and that is accessible to
the application? If you are running on Vista or Win7 and you run the application as
administrator, do you receive the same error?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum