Databases Reference
In-Depth Information
In the beginning, there was only one OLE DB provider—Microsoft OLE DB Provider for
ODBC Drivers. This was a good way for Microsoft to introduce OLE DB, because it
meant that any ODBC provider automatically became an OLE DB provider.
Today, the list of OLE DB providers has grown to include the following (and presumably
there are more of which I am not aware):
Microsoft OLE DB Simple Provider (a JavaBeans-related interface)
Microsoft OLE DB Provider for ODBC Drivers (for Open Database Connectivity)
Microsoft OLE DB Provider for Oracle (for Oracle databases)
Microsoft Jet 3.51 OLE DB Provider (for Jet databases)
Microsoft OLE DB Provider for SQL Server (for SQL Server databases)
Microsoft OLE DB Provider for Directory Services (provides directory services—
that is, logon, administration and replication services—for Windows NT Server
networks)
Aside from the ODBC provider, the SQL Server provider is used most often in examples,
so we will not do so here. On the PC side, I think that the most interesting OLE DB
providers are the Jet provider and the ODBC provider, especially since the latter can be
used to connect to such things as Excel spreadsheets and text documents. Accordingly,
we will take a look at how to set up connection strings using these two providers.
17.6.1 The Microsoft Jet 3.51 OLE DB Provider
Oddly enough, the MSDN Library (which is now the main source of documentation for
Microsoft's development platforms) does not seem to document the Jet 3.51 OLE DB
provider—at least I couldn't find any documentation on it. However, some
experimentation will yield sufficient details to use the provider.
You may be wondering why you would want to use this OLE DB provider to connect to a
Jet database when DAO was specifically designed for this purpose and works quite well.
This is a fair question. I suppose one answer is that we had better stay current with
Microsoft's technology, or we may find ourselves in trouble later on. Frankly, I wish I
had a better answer at this time.
The place to start is with the results of the ListDPs procedure shown earlier for the Jet
provider:
CLSID = {dee35060-506b-11cf-b1aa-00aa00b8de95}
InprocServer32 = C:\Program Files\Common Files\system\ole
db\MSJTOR35.DLL
OLE DB Provider = Microsoft Jet 3.51 OLE DB Provider
ProgID = Microsoft.Jet.OLEDB.3.51
VersionIndependentProgID = Microsoft.Jet.OLEDB
Recall that we can use either the ProgID entry or the OLE DB Provider entry as the value
of the Provider property of the Connection object.
Search WWH ::




Custom Search