|
IDL DataMiner Guide: Using the IDL DataMiner |
|
Once you have created a Database object, you can connect to a database. IDL DataMiner offers two options for accessing databases:
DIALOG_DBCONNECT is a function used to connect to a database using ODBC dialog boxes. These dialogs prompt you for information required to connect to the desired database.
To connect to a database using the DIALOG_DBCONNECT function, enter the following at the IDL prompt:
status = DIALOG_DBCONNECT(objDB)
The SQL Data Sources dialog box appears. This dialog box lists the currently defined Data Sources; it looks something like the following figure:
You can take one of three actions:
| Note Due to Motif library inconsistencies, this dialog may fail on some UNIX systems. |
Define a new data source for the system by selecting the desired ODBC driver from the list and clicking the OK button. The dialog box will close and you will be connected to a database. In some cases, you will see an additional configuration dialog after the Add Data Source dialog closes.
To connect to a database using the database object's Connect method, enter the following at the IDL prompt:
objDB->Connect, datasource = source_name
where source_name is the name of the data source. One way to specify the datasource name is to provide an index into the array of datasource names created with the IDL commands shown in Finding Available Databases, above. For example, if you wanted to connect to the first available datasource in the list of available sources, you might use the following IDL commands:
sources = objDB->GetDatasources() mysource = sources[0].datasource objDB->Connect, datasource = mysource
Once you have connected to a database, you can perform several operations using IDL DataMiner methods. These operations include:
IDL Online Help (March 06, 2007)