Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a local recordset in Access 1

Status
Not open for further replies.

ilgale

Technical User
Jun 8, 2007
2
IT
I'm in Access, and I've to develop and application that import data from an Excel SpreadSheet and copy such data into an Access table.

I've used the following code to open the Excel Spreadsheet:

Dim xl As Object
Set xl = CreateObject("Excel.Application")
xl.Workbooks.Open "D:/Foglio.xls"

and it works....

now, how can I open the CurrentDb in other to copy data
into a speific table ? I've tryed with ADoRecordset
but it fire a runtime error for the following instruction:

Dim myRec As AdoRecordset

Can someone help me ?
Thanks a lot.
 
Dim myRec As ADODB.Recordset

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks, the object is succesfully created, then..
how can I open a specific table of the local database
(CurrentDb) ?

The instruction:
Set myRec = CurrentDb.OpenRecordset("TabellaGale")

doesn't work.... maybe I've to use some specific
instruction for Ado interface....
 
ilgale, CurrentDb.OpenRecordset returns a DAO.Recordset object.
Furthermore, why not simply play with the DoCmd.TransferSpreadsheet method ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top