Connecting From Application Software [ HP PC API User's Guide for ALLBASE/SQL and IMAGE/SQL ] MPE/iX 5.0 Documentation
HP PC API User's Guide for ALLBASE/SQL and IMAGE/SQL
Connecting From Application Software
Application software may have specific requirements for connection to PC
API. Those requirements are discussed here.
Connecting from Q+E Database Editor
To use the Q+E Database Editor to connect to ALLBASE/SQL, follow these
steps:
1. Go to the File menu and click on Logon.
2. At the Logon dialog box, move the cursor down and highlight
SQLBase as shown below. To access ALLBASE/SQL, use the SQLBase
driver supplied on the product diskettes from Q+E Software.
Figure 3-4. Logon Dialog Box
3. Log on using server1 and sysadm as shown below.
Figure 3-5. Server Dialog Box
4. Click OK; then proceed to use Q+E to open and manipulate tables
using the commands described in the Q+E manuals.
Connecting from the Q+E Database Library
You can access ALLBASE/SQL with the Q+E Database Library from
applications written in languages such as C, C++, and Visual Basic. To
use the Q+E Database Library, use the Gupta SQLBase driver supplied on
the product diskettes from Q+E Software. For more information, refer to
the Q+E manuals.
Connecting from Quest
Quest uses special CATALOG tables rather than the SYSSQL views to connect
to ALLBASE/SQL. Each DBEnvironment must contain these catalog tables. To
connect from Quest, follow these steps:
* From the PC API program group, double click on the Scriptor icon.
* Enter catalog.scp in the Path/Script Filename field and click on
Execute, or press Enter.
* If you use Quest exclusively, you can delete the SYSSQL views. To
delete these views, use the UNVIEWS.SCP or UNVIEWS.SQL files.
If you need to delete the Quest CATALOG tables, you can use the
UNCATALG.SCP or UNCATALG.SQL files in the same way that you use the
UNVIEWS.SCP or UNVIEWS.SQL files.
The Catalog Script creates tables prefixed by SYSSQL.SYS. Do not create
tables prefixed by SYSSQL.SYS as these tables would not be displayed in
Quest. For example, Quest would not display SYSSQL.SYSSCOLUMNS or
SYSSQL.SYSKAT in its pull-down menu for its Table Open function. PC API
considers tables owned by CATALOG, SYSTEM, or SYSSQL with the table name
prefixed by SYS as system tables.
Quest is the only product supported by PC API that requires the Catalog
Script to be run. All others require the Views Script.
Connecting From SQLWindows
When you connect to an ALLBASE/SQL DBEnvironment from SQLWindows, you
make an Sqlconnect call, using the SqlUser and SqlDatabase reserved
variables. PC API uses the values associated with these variables to
build the connection string for an ALLBASE/SQL database. The following
example shows how to use an Sqlconnect call from an SQLWindows
application:
Set SqlUser = `user3'
Set SqlDatabase = `server2'
Set bhSqlPrimary = SqlConnect(hSqlPrimary)
If bhSqlPrimary = TRUE
:
For complete information about Sqlconnect, refer to the Gupta manuals.
The value in SqlDatabase is used as a search string in the SQL.INI file
and is matched to the database code parameter of the connection string
syntax. The value in SqlUser is matched to the user code parameter. PC
API then builds the actual connection string that is transmitted over the
network by replacing the database code with the node and DBEnvironment
name and replacing the user code with the logon string.
When you customize your system, you add the appropriate connection string
information to the SQL.INI file. Refer to the section "Maintaining the
SQL.INI File" for information on the SQL.INI file.
Connecting from Express Windows and SQLTalk
These products are included with the SQLWindows product from Gupta.
To enable a list of database names to be produced from the mpedbname, the
entry in the SQL.INI file needs the server1 label. This entry must point
to a valid DBEnvironment name.
The mpedbname entry in the SQL.INI file needs the sysadm label. This
entry must specify a user that can connect to the DBEnvironment that maps
to server1.
MPE/iX 5.0 Documentation