Function SQLDriverName(DatabaseInterface, DriverNo)


With the function SQLDriverName you can determine the name of a certain ODBC driver on your system. This function is designed to be used in conjunction with the SQLNumberOfDrivers function.

     DatabaseInterface,   ! (input) an element expression
     DriverNo,            ! (input) an integer expression



Element value into the set AllDatabaseInterfaces. Currently, this set contains only the value ‘ODBC’.


An integer containing the number of the ODBC driver for which you want to retrieve the name. To determine the maximum value of this argument, please use the function SQLNumberOfDrivers prior to calling this function. The minimum value of this argument is 1.

Return Value

The function returns the name of the ODBC driver (specified by the DatabaseInterface argument), with the number as specified through the DriverNo argument. If you specify a number outside of the correct range, AIMMS will display an error message.


Typically, this function can best be used in a construction like the following:

NumberOfDrivers := SQLNumberOfDrivers('ODBC');

while LoopCount <= NumberOfDrivers do
    DriverName := SQLDriverName('ODBC', LoopCount);
    ! Do something with the retrieved table name here...

The retrieved name of an ODBC driver, can be used as argument in the function SQLCreateConnectionString.

See also

The functions SQLNumberOfDrivers and SQLCreateConnectionString.