SQLConfigDriver Function
When SQLConfigDriver returns FALSE, an associated *pfErrorCode value 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_GENERAL_ERR |
General installer error |
An error occurred for which there was no specific installer error. |
|
ODBC_ERROR_INVALID_BUFF_LEN |
Invalid buffer length |
The lpszMsg argument was invalid. |
|
ODBC_ERROR_INVALID_HWND |
Invalid window handle |
The hwndParent argument was invalid. |
|
ODBC_ERROR_INVALID_REQUEST_TYPE |
Invalid type of request |
The fRequest argument was not one of the following: ODBC_INSTALL_DRIVER ODBC_REMOVE_DRIVER The fRequest argument was a driver-specific option that was less than or equal to ODBC_CONFIG_DRIVER_MAX. |
|
ODBC_ERROR_INVALID_NAME |
Invalid driver or translator name |
The lpszDriver argument was invalid. It could not be found in the registry. |
|
ODBC_ERROR_INVALID_KEYWORD_VALUE |
Invalid keyword-value pairs |
The lpszArgs argument contained a syntax error. |
|
ODBC_ERROR_REQUEST_FAILED |
Request failed |
The installer could not perform the operation requested by the fRequest argument. The call to ConfigDriver failed. |
|
ODBC_ERROR_LOAD_LIBRARY_FAILED |
Could not load the driver or translator setup library |
The driver setup library could not be loaded. |
|
ODBC_ERROR_OUT_OF_MEM |
Out of memory |
The installer could not perform the function because of a lack of memory. |
SQLConfigDriver allows an application to call a driver's ConfigDriver routine without having to know the name and load the driver-specific setup DLL. A Setup program calls this function after the driver setup DLL has been installed. The calling program should be aware that this function might not be available for all drivers. In such a case, the calling program should continue without error.
An application can request driver-specific features exposed by the driver by using the fRequest argument. The fRequest for the first option will be ODBC_CONFIG_DRIVER_MAX+1, and additional options will be incremented by 1 from that value. Any arguments required by the driver for that function should be provided in a null-terminated string passed in the lpszArgs argument. Drivers providing such functionality should maintain a table of driver-specific options. The options should be fully documented in driver documentation. Application writers who use driver-specific options should be aware that this use will make the application less interoperable.
Connection pooling timeout properties can be set when you set the configuration of the driver. SQLConfigDriver is called with an fRequest of ODBC_CONFIG_DRIVER and lpszArgs set to CPTimeout. CPTimeout determines the period of time that a connection can remain in the connection pool without being used. When the timeout expires, the connection is closed and removed from the pool. The default timeout is 60 seconds.
When SQLConfigDriver is called with fRequest set to ODBC_INSTALL_DRIVER or ODBC_REMOVE_DRIVER, the Driver Manager loads the appropriate driver setup DLL and calls the ConfigDriver function. When SQLConfigDriver is called with an fRequest of ODBC_CONFIG_DRIVER, all processing is performed in the ODBC installer, so that the driver setup DLL does not have to be loaded.
|
For information about |
See |
|---|---|
|
Adding, modifying, or removing a driver |
ConfigDriver(in the setup DLL) |
|
Removing the default data source |