How to: Add a Data Source (ODBC)

New: 14 April 2006

You can add a data source by using ODBC Administrator, programmatically (by using SQLConfigDataSource), or by creating a file.

  1. From the Control Panel, access Administrative Tools and then Data Sources (ODBC). Alternatively, you can invoke odbcad32.exe.

  2. Click the User DSN, System DSN, or File DSN tab, and then click Add.

  3. Click SQL Server, and then click Finish.

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

  1. Call SQLConfigDataSource with the second parameter set to either ODBC_ADD_DSN or ODBC_ADD_SYS_DSN.

  1. Call SQLDriverConnect with a SAVEFILE=file_name parameter in the connect string. If the connect is successful, the ODBC driver creates a file data source with the connection parameters in the location pointed to by the SAVEFILE parameter.

Community Additions