The following specification of SQLInstallDriverEx is from the Microsoft ODBC SDK Reference.
SQLConfigDriver loads the appropriate driver setup DLL and calls the ConfigDriver function.BOOL SQLConfigDriver ( HWND hwndParent, WORD fRequest, LPCSTR lpszDriver, LPCSTR lpszArgs, LPSTR lpszMsg, WORD cbMsgMax, WORD* pcbMsgOut);
Parent window handle. The function will not display any dialog boxes if the handle is null.
Type of request. fRequest must contain one of the following values:
ODBC_CONFIG_DRIVER: Changes the connection pooling timeout used by the driver.
ODBC_INSTALL_DRIVER: Installs a new driver.
ODBC_REMOVE_DRIVER: Removes an existing driver.
This option can also be driver-specific, in which case the fRequest for the first option must start from ODBC_CONFIG_DRIVER_MAX+1. The fRequest for any additional option must also start from a value greater than ODBC_CONFIG_DRIVER_MAX+1.
The name of the driver as registered in the system information.
A null-terminated string containing arguments for a driver-specific fRequest.
A null-terminated string containing an output message from the driver setup.
Length of lpszMsg.
Total number of bytes available to return in lpszMsg. If the number of bytes available to return is greater than or equal to cbMsgMax, the output message in lpszMsg is truncated to cbMsgMax minus the null-termination character. The pcbMsgOut argument can be a null pointer.
The function returns TRUE if it is successful, FALSE if it fails.
When SQLConfigDriver returns FALSE, an associated *pfErrorCode value may 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.
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 may 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 make use of driver-specific options should be aware that this use will make the application less interoperable.
Setting Connection Pooling Timeout
Connection pool timeout properties can be set when setting the configuration of the driver. SQLConfigDriver is called with an fRequest of ODBC_CONFIG_DRIVER and lpszArgs set to CPTimeout.
CPTimeout determines the amount 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 SQL_INSTALL_DRIVER or SQL_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 the driver setup DLL does not need to be loaded.
A driver setup routine can send a text message to an application as null-terminated strings in the lpszMsg buffer. The message will be truncated to cbMsgMax minus the null-termination character by the ConfigDriver function if it is greater than or equal to cbMsgMax characters.
Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40