Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 2.42 KB

configuring-the-sql-server-odbc-driver-add-a-data-source.md

File metadata and controls

42 lines (27 loc) · 2.42 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Add a Data Source (ODBC)
Learn how SQL Server ODBC driver calls stored procedures as remote stored procedures in SQL Server using the remote stored procedure call mechanism.
markingmyname
maghan
04/15/2024
sql
native-client
reference
data sources [ODBC]

Configuring the SQL Server ODBC Driver - Add a Data Source

[!INCLUDESQL Server Azure SQL Database Synapse Analytics PDW]

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.

To add a data source by using ODBC Administrator

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

  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. For more information, see ODBC Data Source Administrator DSN.

To add a data source programmatically

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

To add a file data source

  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.

Related content

Delete a Data Source (ODBC)