Using NS3000/iX Network Services (36920-90008)

Chapter 4 65
Remote Database Access
RDBA Access Methods
The database-access file has the following general format:
FILE dbname;DEV=envId#
DSLINE envid
locuser.locacct=HELLO remuser.remacct
More than one local/remote logon sequence equation may be included in
the file. When you call DBOPEN with the database-access file name, a
remote session is established for the remote user that has been
“equated” with your local logon name. (An @ sign in the remote user,
account, or group name position on the right side of an equation is
automatically replaced by the corresponding local name on the left. An
@ sign in a local name position on the left is replaced by the name you
actually used when you logged on.)
Under the database-access file method, the remote session is released
automatically when the database is closed (with or without an explicit
DBCLOSE call).
Before you can reference a database-access file in a program, you have
to ACTIVATE it by means of the DBUTIL utility program. At the MPE/iX
prompt, type the following command (user input is bold):
RUN DBUTIL.PUB.SYS
>>ACTIVATE dbaccessfilename
VERIFICATION FOLLOWS:
FILE COMMAND: LOOKS GOOD
DSLINE COMMAND: LOOKS GOOD
HELLO COMMAND: LOOKS GOOD
ACTIVATED
>>EXIT
DBUTIL checks to see that the file has a file code of zero, is an
unnumbered, ASCII file, has a record length not greater than 128
characters, and contains at least three records. In order to edit the
database-access file or prevent programs from referencing it, you must
issue a DEACTIVATE command within the DBUTIL program.
One of the benefits of the database-access file method is that it restricts
who may use the database and thereby enhances security. (The
contents of the database-access file itself can be hidden from the user
who simply runs the application program.) Under this method,
however, you can access only one database in any one remote session.
Under the other two methods, you can access more than one database
by means of multiple FILE commands.
You can use QUERY, Hewlett-Packard’s interactive database inquiry
facility, to retrieve information from a remote database. You could run
QUERY.PUB.SYS locally, specifying either the database name itself or
the appropriate database-access file name. If you use the actual
database name, you must have previously established a session on the
remote node and issued a FILE command for the remote database.
It is more efficient to run QUERY directly in the remote environment. At
the MPE/iX prompt, type the following commands (user input bold):