The ADO Object Model - OLE DB Providers
(Page 6 of 9 )
I’ve already mentioned that ADO can connect to many different data providers, and this is because of OLE DB. Remember that ADO is just a layer sitting on top of OLE DB to hide the complexity. It seems sensible, though, to look at some of these OLE DB data providers in more detail. You need to see their differences, for although most of the ADO usage will be the same, OLE DB providers don’t always support the same facilities. This is natural, because some of them are fundamentally very different. Most of the relational database providers, for example, will provide similar facilities, but other providers (such as for Internet Publishing) might not work the same way.
When you install MDAC, you are supplied with the following OLE DB providers:
| Provider | Description |
| MSDASQL | Microsoft OLE DB Provider for ODBC: allows connection to existing ODBC data sources via either a System DSN or dynamically provided connection details. See Chapter 1 for how ODBC Drivers relate to OLE DB. |
| Microsoft.Jet.OLE DB.4.0 | Microsoft OLE DB Provider for Jet: allows connections to be established directly to Microsoft Access databases, including Access 97 and Access 2000. |
| SQLOLEDB | Microsoft OLE DB Provider for SQL Server: allows connections to be established directly to Microsoft SQL Server databases. |
| MSDAORA | Microsoft OLE DB Provider for Oracle: allows connections to be established to Oracle databases. |
| MSIDXS | Microsoft OLE DB Provider for Index Server: allows connections to be established to Microsoft Index Server. |
| ADSDSOObject | OLE DB Provider for Microsoft Directory Services: allows connections to be established to Directory Services such as the Windows 2000 Active Directory and the Windows NT 4 Directory Services. |
| MSDataShape | Microsoft OLE DB Data Shape Provider: provides the ability to create hierarchical recordsets. |
| MSPersist | Microsoft OLE DB Persistence Provider: allows recordsets to be saved or persisted and later reconstructed. |
| MSDAOSP | Microsoft OLE DB Simple Provider: allows connections to be established to custom OLE DB Providers that expose simple (relational) data. |
| MSDAIPP.DSO.1 | Microsoft OLE DB Provider for Internet Publishing: allows connections to be established to DAV-compliant servers to aid publishing data on the Internet. |
These are just the defaults supplied, some of which may not appear, depending upon your installation options. For example, Index Server does not act as a remote provider, and you can connect to only local Index Servers. Therefore, if you do not have Index Server on your machine, the MSIDXS may not be installed. Installation of versions later that 2.6 on top of an earlier version will not remove any deprecated providers, and these will not be installed on a clean MDAC 2.8 install.
You can find out which providers are available on your system by creating a new Data Link. This is similar to an ODBC DSN, but for OLE DB connections. By using Windows Explorer, you can create one in any directory simply by right-clicking (or selecting the File menu), picking New, and selecting Microsoft Data Link. This creates a file with a .udl extension, and you can then view its properties. If this option isn’t available, you can create a text file and rename the extension to .udl. Open the UDL file by double-clicking it. From the Provider tab in the Data Link Properties window, you can see the available providers, as shown here:

In fact, using the Data Link is a good way to create connection strings if you are unfamiliar with them; you can even use them instead of a DSN within connection strings (see the next section). You can create a Data Link file, filling in the details onscreen, and then examine the resulting .udl file in Notepad.
 | This chapter is from ADO Programmer's Referencep,by David Sussman. (Apress Books, 2004, ISBN: 1590593421). Check it out at your favorite bookstore today. Buy this book now! |
Next: Connection Strings >>
More ASP.NET Articles
More By Apress Publishing