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

290 Chapter6
Host Language Access
FORTRAN 77
Integer*2 Error_Buffer(40)
Equivalence (Error_Buffer(1),Error_Buffer_Text)
Integer*4 Error_Length
Integer*2 Answer
Parameter (In=5,Out=6)
Call DBERROR (Status,Error_Buffer,Error_Length)
Write(Out,*)'--------------------------------------'
Write(Out,10)Error_Buffer_Text
10 Format(A60)
Write(Out,*)'--------------------------------------------'
Call DBEXPLAIN (Status)
Answer=0
Write(Out,*)'---Enter, <1> to ABORT..., <2> to Continue >'
Read (In,20) Answer
20 Format(I2)
If (Answer.NE.1) Then
Write(Out,*)' Continuing......'
Else
Stop
Endif
Return
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 that 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.
C*****************************************************************
Subroutine Open_The_Database
C
C ACCESS : Mode 1 - Shared Modify Access (SMA) with locking required
C
C CALLED BY : Main Line
C
C CALLS : DBOPEN in mode 1 (SMA)
C Get_Error_And_Explain
C
$List Off
$Include 'comon1'
$List On
C**** Prepare the Base parameter of the DBOPEN.
C
Mode1_SMA = 1
BaseName=' ORDERS; '