Configuring OLE DB Clients
Configuring OLE DB clients to connect to an instance of Microsoft® SQL Server™ requires making the server name and connection information available to the client (or OLE DB consumer) through an OLE DB provider. SQL Server connections through OLE DB are generally made using either:
- Microsoft OLE DB Provider for SQL Server (SQLOLEDB).
- Microsoft OLE DB Provider for ODBC.
Connecting SQLOLEDB Clients
SQLOLEDB, the SQL Server native OLE DB provider, exposes interfaces to consumers who want access to data on one or more instances of SQL Server. Using SQLOLEDB allows you to develop an OLE DB consumer optimized for SQL Server databases. Unlike the Microsoft OLE DB Provider for ODBC, which can access data from a number of OLE DB-compliant ODBC applications, you can only use SQLOLEDB with SQL Server. You cannot use the information in an ODBC SQL Server data source name (DSN) to make a connection.
When setting up clients through the Microsoft OLE DB Provider for SQL Server, the client should provide the necessary connection attributes, and either prompt for connection data or supply that data from an OLE DB data source saved in a persisted file.
Connecting OLE DB Provider for ODBC Clients
Using the Microsoft OLE DB Provider for ODBC allows you to use a single OLE DB provider to connect to multiple ODBC data sources, including SQL Server. However, connecting to SQL Server clients with this provider has more administrative overhead than using the native Microsoft OLE DB Provider for SQL Server.
Usually, when connecting to an instance of SQL Server using the Microsoft OLE DB Provider for ODBC, the information you need is created through the ODBC Data Source Administrator and saved in a SQL Server ODBC DSN (as either a user, system, or file DSN). Therefore, you can code your application to use a SQL Server DSN to make a connection.