top of page
Search
jessyelunday2117x7

Microsoft ActiveX Data Objects 2.x Library: Understanding the ADO Object Model and Events



Objects instantiated with CreateObject are late-bound, which means that they are not strongly typed and command-line completion is disabled. However, it does allow you to skip referencing the ADO library from your project, and enables you to instantiate specific versions of objects. For example:


The simple answer to the question is yes. Pick the version of ADO youwant to use and ignore MDAC.A more detailed and really boring answer follows. [You can easily andsafely exit here.]When ADO was introduced and for most of its history it was supportedby a team separate from the development or system groups. It hadseparate release cycles from any other product. Products that shippedwith MDAC, included whatever current version was available and couldbe later updated with subsequent MDAC releases.The MDAC was the keystone of what Microsoft called "Universal Access",the idea of a single assortment of tools providing access to any datasource through a single access library. ODBC had gone a long way toproviding this sort of functionality, but ODBC was tied to a singlehierarchical data model - ADO and OLE DB removed this limitation.To implement this grand strategy MS adopted its other rising star -COM - that's where and why OLE is so much a major player.A major point of confusion is that while MDAC releases were/are namedafter the most current version of ADO (the ActiveX Data Objects) theysupported - the MDAC is actually a package of diverse though relatedcomponents - the principle catagories being OLE 'system' support, OLEDB components and OLE DB Providers, and the ADO data access library.(These packages originally also included ISAM and ODBC drivers, andthe DAO data access library, ie - one-stop shopping for all dataaccess.)The strategy was grand and ambitious. Perhaps too ambitious asproblems appeared almost immediately in trying to keep such a diverseasssortment of tools all current (and provide bug fixes and upgrades)in a single package. Or perhaps it was mostly marketing and MS neverreally expected it to be all that Universal in the first place.One problem was the ADO data access libraries, the second was theimprovement and fixes of the OLE/OLE DB components. While ADO itselfis essentially non-system dependent, OLE is totally system dependent,and OLE DB was product dependent as well as having a foot in both ADOand OLE.It would take too long to document all the various changes to theMDAC package in its migration from a 'universal' store house to a'specific' ADO/OLE tool, and such information isreadily available on the web, but to highlight a few ...The ADO libraries improved in features and needed bug fixes thefastest . (Probably why MDAC releases were named after ADO versions.)To manage this MS adopted the strategy to provide a single namedcomponent that supplied multiple interfaces. This simplified fourthings: 1) With each new ADO release MS simply provided a new interface to theexisting component, 2) Each version had many features in common with previous versions.Keeping them in the same component meant they only had to have one setof code for all,3) as bug fixes and improvements often affected more that one versionof ADO they could provide those fixes at a single point,4) they avoided having multiple versions laying around - one filereplaced the old. Each new release provides support for all previous versions of ADO.Stop and think what the packages might have looked like if MS hadn'tadopted this strategy. We could have had ... msado15.dll msado2.dll msado2b.dll msado25.dll msado25b.dll msado25c.dll msado25d.dll msado26.dll msado26b.dll msado26c.dll msado27.dll msado27b.dll msado28.dll msado28b.dll ...If having multiple interfaces for one component confused developersjust imagine what a mess the above would have been.The same problems existed for the OLE components and MS adopted thesame strategy. For different O/Ss (and the OLE components) MS simplyprovided separate MDAC packages. That's why there is a different onefor Win2000 and below and another one for XP. (Both labeled '2.8' bythe way.)For partly political reasons (MS announced the death of DAO severaltimes and really wanted to push migration to SQL server) and simplybecause the under-lying technology and dependences were so different,DAO, ISAM, and ODBC was removed from the MDAC. Those components aresupplied in separate JET packages.The MDAC has confused and caused doubt for years for otherwisecompetent developers (Mr. Toews's article an excellent example), andfor absolutely NO reason. A zillion bytes have been wasted when therule has ALWAYS been very simple and valid from Day One. Pick theversion of ADO you want to use. If a client doesn't have thecomponents to support that version then have them download or supplythe latest 'n greatest MDAC package - NO MATTER WHAT VERSION OF ADOYOU ARE USING.In general, previous to Vista, every client and developer has alwaysbeen advised to download the most current MDAC package appropriate fortheir system. Not necessarily to support a higher version of ADO butto take advantage of improvements and fixes for both ADO and OLE.Again - NO MATTER WHAT VERSION OF ADO A PARTICULAR PRODUCT IS USING.A developer can also take it as a general rule to develop against ADO2.5. This is because 1) after all this time it is the most stable, 2) the most clients already have it no matter what platform they areusing, and 3) 2.5 provides the bulk of the features a developercommonly uses. But this really has little to do with MDAC, except obviously theclient has to have an MDAC installed that has the components tosupports the version of ADO a program uses. But if everyone simplyinstalls the latest 'n greatest - then it was not, is not, nor shouldit ever be, a problem. [there were a few issues with 2.6, thus thesubsquent quick release of 2.7 and 2.7rtm, followed by their equallyquick demise with the release of 2.8.]IMHO If a developer knows his targets are XP and above then should useADO 2.8, but the advantage is only additonal features (which asalready noted you likely won't need but nice to have if you do. )and by now it is equally stable. And last - all of this is becoming a non-issue since MS now includesADO and OLE/OLE DB as part of Vista and Win7 supplied components (andupdated by SPs and not from a separate 'universal' package). MDAC isgone. So pick any version of ADO you want* it will be supported.MS also now supply OLE DB providers as separate downloads. OLE DB andOLE is likely to remain a platform supported feature.Whew!-ralph[* I don't advise picking anything previous to 2.5 as there aredifferences in behavior and not all the bugs have been fixed.]




microsoft activex data objects 2 x library




If you are not too specific about Microsoft ActiveX data Objects 2.8 library, try Microsoft ActiveX data Objects 2.5 instead. This library is available on all Office versions and you save yourself a whole lot of trouble trying to determine whether the dll is available on a particular machine.


If you click on "OK" to dismiss the References dialog and then use the debug menu to compile your code (Debug > Compile ), you will find that your code compiles okay. But you will likely have a run-time error when your code actually runs, unless you take the time beforehand to "disambiguate" your code. You will have just discovered how reference priority can be an issue, since both the ADO library (aka "Microsoft ActiveX Data Objects 2.x Library") and the DAO library contain several objects with the same name, such as the Recordset object. Without disambiguation, you'll get an ADO Recordset object if the ADO library is higher in priority, instead of a DAO Recordset object. You can use the "Priority" button to move the DAO library above the ADO library, and then your code should not only compile, but it should run as before without a run-time error.


If you are wondering which objects should be disambiguated in VBA code when a database application references both the DAO and ADO libraries, I have a few files included in a Zip archive that you may download here. I have included an Access database which contains a table storing the name of each member of the DAO 3.6 Object Library and the ADO 2.1 Object Library, including the hidden members. The database also contains a query named "Find duplicates for tblADO_DAOObjects." Object names that are present in the recordset of this query should be disambiguated with either ADODB or DAO as a part of the declaration statement in VBA code, so that one does not have to worry about object library priority issues. I have also included an Excel spreadsheet listing all of the members of the DAO 3.6 and ADO 2.1 object libraries, including the hidden members, for handy reference.


ADO (ActiveX Data Objects) is more generic than DAO (the one designed to handle the objects in Access), so supports features of databases other than Access. In the wider world beyond Access, ADO has largely been replaced by the quite different ADO.NET library.


ADO provides only limited ways to manipulate the data structure (typically via DDL query statements), unless you also use the ADOX library which provides the extensions to get to the database catalog.


Manual microsoft activex data objects 2 7 libraryCreating ado objects in visual basic. it contains updated documentation, headers, libs and typelibs for x86, ia64 and amd64 platforms, as well as updated sample applications and developer tools. 6 library > - microsoft activex data objects 2. i am building an excel wb on windows 7 and excel. microsoft activex data objects 6. 8 sdk is for developers who are building applications using ado, ole db, and odbc. microsoft activex data objects 2. the ado version depends on your windows operating system, viz. 1 library ( msado15. 0 library > - microsoft activex data objects 2. 0 library for windows vista, and microsoft activex data objects 2. 2ff7e9595c


0 views0 comments

Recent Posts

See All

Comments


bottom of page