Parameter | Description |
---|---|
sDriver | Driver Name |
Index for a loaded driver
Function DriverIndex String sDriver Returns Integer
Call: | Get DriverIndex sDriver to IntegerVariable |
Driver Index returns the index for a loaded driver. All loaded drivers, managed and unmanaged, have a driver index.
The driver name can be one of the below options.
Constant | Meaning |
---|---|
MSSQLDRV | The Data Access MS SQL driver |
ODBC_DRV | The Data Access ODBC driver |
DB2_DRV | The Data Access DB2 driver |
DATAFLEX | The embedded database |
THis sample shows how to get the driver index and then use it to query a driver database API attribute.
Procedure ShowDriverAttribute Boolean bAttribValue Integer iDriver Get DriverIndex "MSSQLDRV" to iDriver Get_Attribute DF_DRIVER_USE_CACHE of iDriver to bAttribValue Showln "Use cache: " (If(bAttribValue, "YES", "NO")) End_Procedure
A loaded driver may not be registered. This might happen if the driver does support managed connections or a pre-loaded driver has not yet been registered. You can use the DriverCLIHandler method to determine if a driver is registered.
The DriverIndex can be used to communicate with the driver API interface. The DF_DRIVER_xxx API interfaces requires that you pass a driver number. DriverIndex returns that number.