DBOPEN [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
DBOPEN
The DBOPEN statement initiates database access and sets TurboIMAGE's user
class number and access mode for subsequent database operations. The
first two characters in the dbname variable must be blanks.
Syntax
DBOPEN dbname$[, PASSWORD[=]str_expr] [, MODE[=]open_mode]
[, STATUS[=]status_array(*)]
Parameters
dbname$ A string variable whose value is a TurboIMAGE database
name. The first two characters in the string must be
blanks followed immediately by the actual database name.
This variable must be used in all other statements that
call this database.
str_expr Evaluates to the database's password. Required the if
database is protected with a password.
open_mode A numeric expression that evaluates to one of the valid
TurboIMAGE access modes in Table 4-2. See the
description of the DBOPEN library procedure in the
TurboIMAGE/XL Database Management System for more
information. If not specified, the default is seven,
exclusive read.
status_array A 10-element short integer array to which TurboIMAGE
returns an error code. If an HP Business BASIC/XL
database statement specifies the STATUS option, an error
does not abort the program. Following execution of the
database statement the program can check status_array
and handle the error. The values returned by TurboIMAGE
to this array are detailed in the description of the
status parameter of the equivalent TurboIMAGE library
procedure.
Table 4-2. Database Access Modes
-------------------------------------------------------------------------------------------------
| | | | |
| Open | Allows | And concurrent | Concurrent Modes Allowed |
| Mode | | | |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 1 | Modify with enforced locking | Modify | 1, 5 |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 2 | Update | Update | 2, 6 |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 3 | Exclusive modify | None | None |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 4 | Modify | Read | 6 |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 5 | Read | Modify | 1, 5 |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 6 | Read | Modify | 6 and either 2, one 4, or |
| | | | 8 |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 7 | Exclusive read | None | None |
| | | | |
-------------------------------------------------------------------------------------------------
| | | | |
| 8 | Read | Read | 6, 8 |
| | | | |
-------------------------------------------------------------------------------------------------
Examples
The following statements show the use of the DBOPEN statement.
90 Database$ = " Clients" !Database name is preceded by two spaces
100 DBOPEN Data_base$,STATUS=S(*)
110 DBOPEN Data_base$,PASSWORD="synergy",STATUS=S(*)
120 DBOPEN Data_base$,PASSWORD=Pw$,MODE=4,STATUS=S(*)
130 DBOPEN Data_base$,PASSWORD=Pw$,MODE=2,STATUS=Status(*)
140 DBOPEN Data_base$,MODE 1,STATUS Status(*)
150 DBOPEN Data_base$,MODE 7,STATUS S(*)
160 DBOPEN Data_base$,STATUS Status(*)
170 DBOPEN Data_base$,PASSWORD "Quanta",STATUS Status(*)
MPE/iX 5.0 Documentation