Adding a Data Source

ADO and SQL Server

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

  1. In Windows Explorer, select the folder in which to add the new data link.

  2. On the File menu, point to New, and then click Text Document.

  3. Rename the file in the form Filename.udl.

  4. Double-click the new file to open the Data Link Properties window.

  5. Select the Provider tab, select Microsoft OLE DB Provider for SQL Server, and then select the Connection tab.

  6. 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

  1. On the Start menu, point to Settings, and then click Control Panel.

  2. 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.

  3. Click SQL Server, and then click Finish.

    Complete the steps in the Create a New Data Source to SQL Server Wizard.