UseODBCDatabase()

Syntax

Result = UseODBCDatabase()
Description
Initialize the ODBC database environment for future use. It attempts to load the ODBC driver and allocate the required resources.

Parameters

None.

Return value

If Result is 0, then the ODBC driver is not available or is too old (ODBC 3.0 or higher is needed) and the Database functions should not be used.

Remarks

After calling UseODBCDatabase(), a database has to be opened using OpenDatabase() using a registered ODBC database name as database or OpenDatabaseRequester() before using any other Database functions.

It is possible to obtain a list of available drivers by calling the function ExamineDatabaseDrivers().

Example

  UseODBCDatabase()

  If OpenDatabase(0, "MySQL-ODBC", "user", "password")
    Debug "Connected to MySQL"
  Else
    Debug "Connection failed: "+DatabaseError()
  EndIf

See Also

OpenDatabase(), UseSQLiteDatabase(), UsePostgreSQLDatabase(), UseMySQLDatabase()

Supported OS

All

<- UseMySQLDatabase() - Database Index - UsePostgreSQLDatabase() ->