TORONTO USERS GROUP for Midrange SystemsTips from Jackie
raphical
access to the AS/400 database has certainly come into its own
recently. More and more PC packages are able to quickly access
the AS/400 and obtain the data required for decision support purposes.
Open Database Connectivity or ODBC is a standard interface defined by Microsoft.
An ODBC driver accepts formatted requests and passes these on to a specific database.
The Client Access/400 ODBC driver will accept ODBC requests from
a wide variety of applications and will pass the requests to DB2/400
and return the results through the ODBC driver to the originating
application.
Everything you need for database connectivity comes with Client Access/400 for Windows. Prior to testing your ODBC setup you should execute the command "ADDRDBDIRE RDB(system name) RMTLOCNAME(*LOCAL)" on your AS/400. Verify that the subsystem QSERVER has been started. After starting a connection to your AS/400 via Client Access for Windows select the ODBC driver icon and then the 'ADD' button. Choose the Client Access/400 ODBC driver. 'Data Source name' is your choice. Choose the 'SYSTEM' you want this data source name associated with. Through 'Options' you can specify the libraries that you want your end users to have access to. For testing purposes you may want to put only the name of one small library as your Default Library. QIWS is not a good test library. A quick way to check out your ODBC driver is to query a file using the Data Base Access GUI software that comes with CA/400 for Windows. There are usually no special requirements for most applications once you have defined your AS/400 data source. Normally you either open a file and specify its type as CA/400 ODBC or you access the data through some "External Data" option. Some of the tools that have been tested and run without special setup include DB Access GUI, MS Access and MS Excel, Showcase Vista and Vista PRO, Borland's Paradox, Delphi and ReportSmith, Visual Basic, Crystal Reports, Cognos Impromptu, CA Visual Express and Brio Data Prism. Below are unique requirements for a few other common applications.
DN="AS/400" DL="DLODBC"
DD="ODBC for the AS/400"
DC="driver=ehnodbc3.dll";
This is the text describing your ODBC data source. If you have entries following this make sure that you include the semicolon.
Client Access/400 ODBC Driver=16
In the ODBC.INI file in the Windows subdirectory add the statement:
Debug=2
under the heading for your datasource name.
IDQUOTE=
Make sure that nothing follows the equal sign. ReportSmith does not support the correct syntax for Outer Joins.
Most applications require a unique index over a file if you want your users to be able to add or update data. A unique index can be created either via a logical file specifying UNIQUE or through the SQL "CREATE UNIQUE INDEX" statement.
For more details on the tools covered here and also various Powersoft
products including PowerBuilder see the manual "Client Access
Windows 3.1 Client for OS/400 ODBC User's Guide" SC41- 3533.
ODBC access opens up a whole world of exciting client/server tools
that will give your users easier and better access to their data.
T
<
G
Jackie Jansen is an AS/400 Specialist and Consulting SE, providing national technical and marketing support for the AS/400 in Canada. Jackie frequently speaks at AS/400 Technical Conferences and User Group meetings.