564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Linking to ADO databases with VBA
Part two of a five-part series of blogs
Learn how to write VBA macros to add, edit and delete data in Access, SQL Server and other databases, using something called ADO.
To link to data from within VBA, you will usually use the ActiveX Data Objects object library (ADO to its friends).
If you're writing VBA within Access, you may well prefer to use DAO (or the Direct Access Objects library) instead. You can Google ADO or DAO for more details.
You can create a reference to the ActiveX Data Objects library as follows:
Here's what the dialog box looks like:
Make sure you tick the box next to the library, rather than just selecting it in the list.
There are 7 different versions of ADO in the dialog box shown above - which one should you use? The short answer is: the highest version number. For more information on different versions of ADO, see this Microsoft ADO version history page.
Functionally ADO 2.8 and 6.0 are the same: the only difference is that 6.0 was provided for Windows Vista and later operating systems.
Now that you're referring to the ADO library, it's time to learn a little about esoterica such as connections and recordsets.
|Parts of this blog|
25 Aytoun Street