ConfigTranslator Function

Version Introduced: ODBC 2.0

ConfigTranslator returns a default translation option for a translator. It can be in the translator DLL or a separate setup DLL.


BOOL ConfigTranslator(  
     HWND     hwndParent,  
     DWORD *  pvOption);  


[Input] Parent window handle. The function will not display any dialog boxes if the handle is null.

[Output] A 32-bit translation option.


The function returns TRUE if it is successful, FALSE if it fails.


When ConfigTranslator returns FALSE, an associated *pfErrorCode value is posted to the installer error buffer by a call to SQLPostInstallerError and can be obtained by calling SQLInstallerError. The following table lists the *pfErrorCode values that can be returned by SQLInstallerError and explains each one in the context of this function.

*pfErrorCode Error Description
ODBC_ERROR_INVALID_HWND Invalid window handle The hwndParent argument was invalid or NULL.
ODBC_ERROR_DRIVER_SPECIFIC Driver- or translator-specific error A driver-specific error for which there is no defined ODBC installer error. The SzError argument in a call to the SQLPostInstallerError function should contain the driver-specific error message.
ODBC_ERROR_INVALID_OPTION Invalid translation option The pvOption argument contained an invalid value.


If the translator supports only a single translation option, ConfigTranslator returns TRUE and sets pvOption to the 32-bit option. Otherwise, it determines the default translation option to use. ConfigTranslator can display a dialog box with which a user selects a default translation option.

For information about See
Getting a translation option SQLGetConnectAttr
Selecting a translator SQLGetTranslator
Setting a translation option SQLSetConnectAttr