SQLConfigDataSource

The SQLConfigDataSource function is used to add, modify, or delete a data source dynamically. It uses the keywords in the following table. Note that only the SERVER keyword is required for this function; all other keywords are optional.

Keyword Description
ADDRESS The network address of the SQL Server database management system from which the driver retrieves data.
DATABASE The name of the SQL Server database.
DESCRIPTION A description of the data in the data source.
LANGUAGE The national language to be used by SQL Server.
NETWORK The network library that connects the platforms on which SQL Server and the SQL Server driver reside.
OEMTOANSI Enables conversion of the OEM character set to the ANSI character set if the SQL Server client machine and SQL Server are using the same non-ANSI character set. Valid values are YES for on (conversion is enabled) and NO for off. The default value is set by using the SQL Client Configuration Utility.
SERVER The name of the network computer on which the data source resides.
TRANSLATIONDLL The name of the DLL that translates data passing between an application and a data source.
TRANSLATIONNAME The name of the translator that translates data passing between an application and a data source.
TRANSLATIONOPTION Enables translation of data passing between an application and a data source.
USEPROCFORPREPARE Disables generation of stored procedures for SQLPrepare. Valid values are NO for off (generation is disabled) and YES for on. The default value (set in the Setup dialog box) is YES.

Note that keyword pairs in SQLConfigDataSource strings are null-byte (\0) terminated, and the string itself is also null-byte (\0) terminated. For example:

DSN=Human Resources\0SERVER=hrserver\0ADDRESS=hrnetaddr\0
    NETWORK=DBMSSOCN\0DATABASE=payroll\0\0