Creating a Database Object
To connect to a database, you must first create an IDL Database Object using the following statement:
The newly-created database object represents a connection to a datasource. The object is not considered valid until a connection to the datasource is made, either via the Connect method of the IDL Database Object or the DIALOG_DBCONNECT function.
Once the Database Object has been created, you can perform operations including:
Finding Available Databases
To find out which databases are available, use the database object's GetDatasources method as follows.
The result is an array of IDL structures containing the datasource names and descriptions of all available data sources. See IDLdbDatabase::GetDatasources for further information on this structure.
Finding a Specific Database
To find out if a specific database is available, inspect the list of datasources returned by the GetDatasources method. The following IDL commands check to see if "Informix" is listed in the array of data sources, and if so, print the word "Yes" to the IDL command log:
If the desired database is reported as available, the database driver is installed on your system. You will still need to make sure that the driver is configured correctly before you are able to connect to a database.