ODBCCONF.EXE

ODBCCONF.exe is a command-line tool that allows you to configure ODBC drivers and data source names.

Note

ODBCCONF.exe will be removed in a future version of Windows Data Access Components. Avoid using this feature, and plan to modify applications that currently use this feature. You can use PowerShell commands to manage drivers and data sources. For more information about these PowerShell commands, see Windows Data Access Components cmdlets.

Syntax

ODBCCONF [switches] action  

Arguments

switches
Zero or more switch options. For the list of available switches, see the Remarks section, later in this topic.

action
One action to perform. For the list of available options, see the Remarks section.

Remarks

The following switches are available:

Switch Description
/A {action} Specify an action.

/A is optional if only one action is specified.
/? Display usage for ODBCCONF.EXE.
/C Processing continues if an action fails.
/E Erase the response file specified with /F when processing is finished.
/F Use a response file, such as odbcconf /F my.rsp.

my.rsp might look like this: REGSVR c:\my.dll

/A is not used in a response file.
/H Display usage (Help). This switch is the same as /?.
/L[mode] filename Send program output to a file in one of three modes: normal (n), verbose (v), and debug (d). Debug mode records the DLLs that are loaded by odbcconf.exe.

If you specify /L without a mode, the log file will be empty.

For example, /Lv log.txt.
/R The action will be performed after a restart.
/S Silent mode. Do not display error messages.

The following actions are available:

Action Description
CONFIGDRIVER driver_name**driver-specific configuration params Loads the appropriate driver setup DLL and calls the ConfigDriver function.

Equivalent to the SQLConfigDriver function.

For example:

/A {CONFIGDRIVER " Driver Name" "CPTimeout=60"}

/A {CONFIGDRIVER " Driver Name" "DriverODBCVer=03.80"}
CONFIGDSN driver_name DSN=name | attributes Adds or modifies a user data source.

Equivalent to the SQLConfigDataSource function.

For example:

/A {CONFIGDSN "SQL Server" "DSN=name | Server=srv"}
CONFIGSYSDSN driver_name DSN=name | attributes Adds or modifies a system data source.

Equivalent to the SQLConfigDataSource function.

For example:

/A {CONFIGSYSDSN "SQL Server" "DSN=name | Server=srv"}
INSTALLDRIVER Equivalent to SQLInstallDriverEx Function.

For information about the keyword-value pairs syntax passed to INSTALLDRIVER, see Driver Specification Subkeys.

For example:

/A {INSTALLDRIVER "Your Driver | Driver=c:\your.dll | Setup=c:\your.dll | APILevel=2 | ConnectFunctions=YYY | DriverODBCVer=03.50 | FileUsage=0 | SQLLevel=1"}
INSTALLTRANSLATOR translator configuration**driver path Adds information about a translator to the HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Translators registry key.

Equivalent to SQLInstallTranslatorEx Function.

For information about the keyword-value pairs syntax passed to INSTALLDRIVER, see Translator Specification Subkeys.

For example:

/A {INSTALLTRANSLATOR "My Translator | Translator=c:\my.dll | Setup=c:\my.dll"}
REGSVR dll Registers a DLL.

Equivalent to regsvr32.exe.

For example:

/A {REGSVR c:\my.dll}
SETFILEDSNDIR When HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC File DSN\DefaultDSNDir does not exist, the SETFILEDSNDIR action will create it and assign it the value at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\CommonFilesDir, appended with \ODBC\Data Sources.

The value at HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC File DSN\DefaultDSNDir specifies the default location used by the ODBC Data Source Administrator when creating a file-based data source.

For example:

/A {SETFILEDSNDIR}

See Also

Microsoft Open Database Connectivity (ODBC)