TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

Chapter 6 297
Host Language Access
Pascal
Var
Error_Buffer : Packed Array [1..80] of Char;
Error_Length : Integer;
Answer : ShortInt;
Begin
DBERROR (Status,Error_Buffer,Error_Length);
Writeln('-------------------------------------------');
Writeln(Error_Buffer);
Writeln('-------------------------------------------');
Writeln;
DBEXPLAIN (Status);
Answer:=0;
Prompt( '---Enter, <1> to ABORT..., <2> to Continue >');
Readln(Answer);
If Answer <> 1 Then Writeln(' Continuing .........')
Else Halt;
End;
Opening the Database
This procedure implements the Open_The_Database procedure of the sample program. All
required values, such as the password, are provided by the routine. Note that the password
DO-ALL is followed by a semicolon because it is less than eight characters long; a blank
can be substituted for the semicolon. Open_The_Database uses open mode 1, which is the
shared modify access mode. Error trapping is done by referring all non-zero conditions to
the Get_Error_And_Explain procedure.
$Page$
Procedure Open_The_Database;
(* Access : Mode 1 - Shared Modify Access (SMA) with locking required
Called By: Main Line
Calls : DBOPEN in mode 1 (SMA)
Get_Error_And_Explain *)
Begin
Mode1_SMA : Integer;
DBname.BaseID :=' ';
DBname.BaseName :='ORDERS; ';
Password :='DO-ALL;';
Mode1_SMA :=1;
DBOPEN (DBname,Password,Mode1_SMA,Status);
If Status.Condition <> 0 Then
Get_Error_And_Explain;
End;