ADO and SQL Server
Adding a Data Source
With ADO, you can connect to an instance of Microsoft® SQL Server™ by using the following types of data sources:
- Microsoft Data Links, using the Microsoft OLE DB Provider for SQL Server (SQLOLEDB).
- ODBC data sources, using the Microsoft OLE DB Provider for ODBC (MSDASQL).
Adding a Microsoft Data Link
You can add a Microsoft Data Link by using Microsoft Windows® Explorer.
To add a Microsoft Data Link by using Windows Explorer
- In Windows Explorer, select the folder in which to add the new data link.
- On the File menu, point to New, and then click Text Document.
- Rename the file in the form Filename.udl.
- Double-click the new file to open the Data Link Properties window.
- Select the Provider tab, select Microsoft OLE DB Provider for SQL Server, and then select the Connection tab.
- Specify a server name, the login type, and the default database.
Adding an ODBC Data Source
You can add a data source by using ODBC Administrator, programmatically (by using SQLConfigDataSource), or by creating a file.
To add a data source by using ODBC Administrator
- On the Start menu, point to Settings, and then click Control Panel.
- Double-click ODBC Data Sources (32bit) (if using Windows 95 or Windows 98) or Data Sources (ODBC) (if using Windows NT 4.0 or Windows 2000), click the User DSN, System DSN, or File DSN tab, and then click Add.
- Click SQL Server, and then click Finish.
Complete the steps in the Create a New Data Source to SQL Server Wizard.