4 Database Manipulation
DBOPEN (base name, password, mode, status)
The parameters are:
[[server][:service]/][Database]
* For Eloquence A.06.xx, this is simply the data base name.
NOTE: The data base name is not case sensitive.
For example:
Db$=" sampledb" DBOPEN(Db$,"",1,S(*))This opens the database sampledb on the local system, using the default service.
Db$=" server/sampledb"
This would connect the default data base server running on the system named "server".
Db$=" server:eloqdb5/path/to/sampledb"
This would connect the data base server, running on the system named "server" using the port associated with the service name "eloqdb5". For Eloquence A.05.xx compatible data bases, it is required to specify an absolute path.
All the connection details could be hidden in a VOLUME definition. If a volume DBVOL is defined as below (for example in your .eloqrc file)
DBVOL="server:eloqdb5/path/to"
then the code below
Db$=" sampledb,DBVOL"
would connect to data base server:eloqdb5/path/to/sampledb.
Mode 1: Modify shared with database locking. Data entries may be read and written within the constraint of the user-class number granted by DBOPEN. Databases opened in mode 1 should be locked (DBLOCK) before data set entries may be added, deleted, or modified. If one user uses DBLOCK, all others also have to lock.
Mode 3: Modify exclusive. DBLOCK and DBUNLOCK statements are not required in this mode. Exclusive access is obtained for reading and/or writing. Although the database may change in content, it does so under your exclusive control. Control is relinquished after executing a DBCLOSE operation. Other requests for access to the database are refused until a DBCLOSE operation is executed.
Mode 8: Read shared. The database is opened for shared read access. Writing to the database is not permitted.
Mode 9: Open for read, allow concurrent update. The database is opened for read access. Other programs may open database in modes 1 and 8.
If successful, DBOPEN replaces the first two characters of the base name string variable, formerly blanks, with an ASCII database number between 00 and 09. This is the internal ID number of the database and should not be altered.
A corrupt database is accessible in mode 8. Status ERROR -94 is returned if the database is corrupt.
Array Element | Value | Description |
---|---|---|
1 | 0 | CW. |
2 | 0 through 31 | User-class number. |
3 | 0 | |
4 | 0 | |
5 | 0 | |
6 | Bits 0 through 11 | The DBOPEN identification number (401). |
Bits 12 through 15 | The mode value used to open the database. | |
7 | Program line number | |
8 | 0 | |
9 | Mode number | DBOPEN-mode parameter value (same as bits 12 through 15 of element 6). |
10 | Any value | Reserved. |