PC Review


Reply
Thread Tools Rate Thread

Can you use ADO from Excel to run an Append Query in Access

 
 
Kelii
Guest
Posts: n/a
 
      11th Jul 2010
.... if so, do you mind providing sample code?

I looked everywhere for this and can only find sample code for DAO.
I'm a big fan of DAO (who says ADO is simpler?) but I'm trying to get
into the 21st century.

This is what I have so far:
'Setup ADO for executing action query
Dim cmd As New ADODB.Command
cmd.ActiveConnection = gsCONNECTION
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "qryRecipCompRevenuesAndDisputes_Step3"

'Execute
cmd.Execute

Needless to say it fails miserably and I'm embarassed to post it.

All help appreciated.

Thanks,

Kelii
 
Reply With Quote
 
 
 
 
ManicMiner17
Guest
Posts: n/a
 
      11th Jul 2010
On 11/07/2010 03:16, Kelii wrote:

Kelii,

Have you looked at http://support.microsoft.com/kb/278973


There is a downloadable file ExcelADO.exe

The text contains the following:

"7. Click Sample 4. This sample produces the same results as Sample 1,
but the technique that is used to transfer the data is slightly
different. In Sample 1, records (or rows) are added to the worksheet one
at a time. Sample 4 adds the records in bulk by attaching the Excel
table to an Access database and running an append query (or INSERT
INTO..SELECT FROM) to append records from a table in the Access table to
the Excel table. Once the transfer is complete, the Excel table is
detached from the Access database and the workbook that results is
displayed in Excel. Quit Excel, and return to the Visual Basic application."

 
Reply With Quote
 
Kelii
Guest
Posts: n/a
 
      12th Jul 2010
Thanks for the link, that's what I needed
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Append Query in VBA - to append VBA variable values to Access tabl =?Utf-8?B?QWdlbnQgRGFnbmFtaXQ=?= Microsoft Access VBA Modules 4 1st Nov 2006 04:25 PM
Can I use MS Query in Excel like an Append Query in Access =?Utf-8?B?U2FtIFdhcmRpbGw=?= Microsoft Excel Misc 0 11th Apr 2006 02:41 PM
Link CSV file created query append query to append data =?Utf-8?B?ZXNwYXJ6YW9uZQ==?= Microsoft Access Queries 2 5th Jul 2005 04:49 PM
Error trapping for "MS Access can't append all the records in the append query" Dale Microsoft Access VBA Modules 6 29th Dec 2004 02:27 AM
How do you connect an Access 2002 append query to another access . =?Utf-8?B?amFja2Vs?= Microsoft Access VBA Modules 1 10th Nov 2004 07:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:36 AM.