what wrong in that pro?????

S

SIN

hi,
The code:

Dim cn As ADODB.Connection, rs As ADODB.Recordset
Dim sPath As String

Set cn = New ADODB.Connection
cn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\testing\test.mdb"

Set rs = New ADODB.Recordset

rs.Open "Temp_Rates", cn, adOpenKeyset, adLockOptimistic


sPath = "D:\ImportCurrencyRate.xls"

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "Temp_Rates",
sPath, True ---> eror- the operation requires an open db.

Thaks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top