Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2005, 09:26 AM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO vs DAO for table manipulation

Hello all,

I'm a bit of a newbie in this area and I'd really like some help if possible. My question is: How does one manipulate tables and/or their structures using VBA and ADO? Is there a way or do I have to use DAO? I've researched this for two weeks and I've not been able to find anything that states that there's a way to do this in ADO.

What I'm looking to do is check the tables in the current database when the first form opens. I need to check to see if the linked tables are linked to the correct database and not one of the test DBs, then relink them if they're incorrect. I can do this in DAO, but I wondered if I could/should do this in ADO, so I was checking it out but found a derth of info. An explanation or website would be most helpful and any help is appreciated. Thank you! -RK



She stood on the bridge at midnight,
Her lips were all aquiver.
She gave a cought,
Her leg fell off,
and floated down the river.
__________________
She stood on the bridge at midnight,
Her lips were all aquiver.
She gave a cough,
Her leg fell off,
and floated down the river.
 
Old August 13th, 2005, 02:07 AM
Friend of Wrox
 
Join Date: Jul 2005
Posts: 150
Thanks: 0
Thanked 0 Times in 0 Posts
Default

DAO is what Access uses to work the the JET engine to do any table operations. Even is you write your code in ADO, Access has to translate it back into DAO code before it is executed. Most of the time, the DAO code will run fast than ADO code.



Boyd
"Hi Tech Coach"
Access Based Accounting/Business Solutions developer.
http://www.officeprogramming.com
 
Old August 15th, 2005, 12:20 PM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ah, so that's how the magic works. Thnx!
 
Old September 26th, 2005, 09:10 PM
Authorized User
 
Join Date: Oct 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Another thing to keep in mind regarding comparison of DAO and ADO
is that while DAO also includes processing for catalog information
(including linking tables), ADO, in itself, does not. In order to
handle catalog processing using ADO, you need to use ADOX.

One of the best resources that I have found for a quick DAO=>ADO
conversion lesson was in a Microsoft Whitepaper named "Migrating from
DAO to ADO. Using ADO with the Microsoft Jet Provider." It was
written in June of 1999 by Alyssa Henry. You may be able to find
a copy using Google or another search engine.

The only thing to keep in mind that if you DO use ADOX in your VBA
application, be sure to include the library named "Microsoft ADO
Ext. 2.7 for DDL and Security" (or a later version, if available),
under your Tools | References in your VBA editor window. Also,
applications written with MS Access 2000 or later do not normally
include the DAO library. If you do need to utilize DAO with a
2000 or later version of MS Access, include the library named
"Microsoft DAO 3.6 Object Library", or a similar version.





Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO or DAO knowledge76 Access VBA 3 October 12th, 2015 04:26 PM
DAO vs. ADO SerranoG Access VBA 11 December 5th, 2006 01:19 PM
Dao to Ado vrtviral Access VBA 5 February 19th, 2005 11:13 AM
ADO vs DAO perrymans BOOK: Expert One-on-One Access Application Development 0 October 24th, 2004 11:36 PM
DAO / ADO? merguvan Access VBA 8 January 18th, 2004 07:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.