| title | Add a Data Source (ODBC) | Microsoft Docs | |
|---|---|---|
| ms.custom | ||
| ms.date | 08/01/2016 | |
| ms.prod | sql | |
| ms.prod_service | database-engine, sql-database, sql-data-warehouse, pdw | |
| ms.reviewer | ||
| ms.technology | native-client | |
| ms.topic | reference | |
| helpviewer_keywords |
|
|
| ms.assetid | b4ac6f0e-8e6a-4b1a-9a7e-60e0a69b2180 | |
| author | markingmyname | |
| ms.author | maghan | |
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEappliesto-ss-asdb-asdw-pdw-md]
Before using ODBC applications with [!INCLUDEssVersion2005] or later, you must know how to upgrade the version of the catalog stored procedures on earlier versions of [!INCLUDEssNoVersion] and add, delete, and test data sources.
You can add a data source by using ODBC Administrator, programmatically (by using SQLConfigDataSource), or by creating a file.
-
From the Control Panel, access Administrative Tools and then either ODBC Data Sources (64-bit) or ODBC Data Sources (32-bit). Alternatively, you can invoke odbcad32.exe.
-
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.
- Call SQLConfigDataSource with the second parameter set to either ODBC_ADD_DSN or ODBC_ADD_SYS_DSN.
- 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.