DBOpen
Use this procedure/function to open the specified database table in the mode you request.
The DBOpen procedure supports having multiple:
- Simultaneous ODBC or JDBC connection via different ODBC or JDBC drivers. See Database Functions for more information.
- Tables open in the same database.
Syntax
DBOpen (Table, Handler, DFDFile, Mode, Truncate)
The system returns one (1) if the database table was successfully opened and zero (0) if the table was not opened.
Possible causes of failure include:
- The table does not exist and the Mode parameter did not include the CREATE_IF_NEW directive.
- The table exists and the Mode parameter included the FAIL_IF_EXISTS directive.
- The database handler could not be initialized.
- The table format information could not be found.
- The table is opened for exclusive use by another application.
Example:
Here is an example:
Procedure | Result | Explanation |
DBOpen ("APPIDX", "ODBC", ,"READ") | 1 or 0 | Will open the table named APPIDX for reading and associate it with the ODBC handler. Table information will be queried from the database driver, if possible. |
DBOpen ("APPIDX", "JDBC", ,"READ") | 1 or 0 | Will open the table named APPIDX for reading and associate it with the JDBC handler. Table information will be queried from the database driver, if possible |
DBOPEN("MYTABLE","ODBC" ,"D:\deflib\mytable.dfd" ,"READ&WRITE&TRUNCATE") |
This DAL statement removes all rows from the table named MYTABLE . |