View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
onedaywhen onedaywhen is offline
external usenet poster
 
Posts: 459
Default ADO from Excel to Access

You don't need a recordset to do this; in fact, using a recordset will
slow down the process.

Because you can connect to both Excel and MS Access using the MS OLEBE
Jet Provider, you can use the INSERT INTO..SELECT syntax, using the IN
keyword to refer to the data source other than the one used for your
ADODB connection object. For example, if you've connection string
refers to your Excel workbook, try something like:

INSERT INTO MyTable IN 'C:\MyJetDB.mdb' SELECT RefID AS KeyCol,
Surname AS ValueCol FROM [PersonalDetails$]

or if your connection object is connected to the MS Access database
use:

INSERT INTO MyTable SELECT RefID AS KeyCol, Surname AS ValueCol FROM
[PersonalDetails$] IN 'C:\MyWorkbook.xls' 'Excel 8.0'

--

"pk" wrote in message ...
Hello, I hope someone can help me please.

I can load an Excel sheet into an ADO recordset. But,
I now need to write the recordset out to an Access table
that already has the appropriately named columns.

Can someone supply me with example code to do this or
point me to a good web site that shows current technology
example code (Excel XP/Windows 2000)?

Thanks in advance for your assistance and example code.