- Trained on our vast library of engineering resources.
Learning MicroStation VBA

Chapter 35: Working With Databases (ActiveX Data Objects)

Access, Oracle, DB2, SQL Server. When there's data to be stored, there is no shortage of Database platforms to store it. Rather than spending time on each Database, we will devote our time to learning about ActiveX Data Objects because with ActiveX Data Objects, we can 'talk' to each of these database products.

Primer on ActiveX Data Objects

ActiveX Data Objects is a technology created by Microsoft that allows for simple yet powerful communication with Databases. Which Databases? Virtually any Database that is 'open'. And what does 'open' mean? Microsoft Access is 'open'. SQL Server is 'open'. Oracle is 'open'. Mainstream databases are 'open'. We can work with them through standard VBA / ADO (ActiveX Data Objects) calls. Some databases, however, are proprietary and as such, are not designed to allow software developers to work with them. So, in general, most databases available to us can be accessed through the use of ActiveX Data Objects.

ActiveX Data Objects allow us to work with databases through the use of several key Objects. Before using "ActiveX Data Objects", we must add a Reference to it. Let's do so right now.

When we look in the References dialog box in VBA, we may see a number of different "ActiveX Data Objects" libraries. In general, it is best to select the highest Library version available. In this example, Version 2.8 is the highest one.

After adding a Reference to the "Microsoft ActiveX Data Objects 2.8 Library", new Objects and Constants are exposed and available...

UNLIMITED FREE ACCESS TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Information and Database Services
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.