A self-contained class file for use in your Access or Excel projects. This file contains late-binded class methods that will allow you—the power user—to control an iSeries (AS400) client-side interface.
This file simply refactors IBM's Host Access Class Library (HACL) for readability and ease-of-use.
Not every single method has been included yet, just many of the ones I've tested and used live. For the complete exhaustive list, visit the original documentation here (which is current as of October 2016):
(My hope is to eventually test, organize, and encapsulate every single HACL method, time permitting).
Just download the zip, extract the files, and then upload the main one ("cAS400.cls") into your VBA project like any other module. This VBA code can also be copy/paste'd directly into an existing VBA class file: just remove the header information first (i.e., the lines at the top from "VERSION..." to "ATTRIBUTE...")
More detailed instructions are listed in the Deployment section below.
An optional module has also been included that provides example usage and additional testing information.
This file assumes that your VBA code can access the iSeries directly, such as through a desktop installation or a remote-in option.
If an additional layer exists between you and the iSeries—for example, if you are on a thin-client, or if your company utilizes a web-interface to access the AS400—then additional steps may need to be taken to successfully utilize the HACL objects.
This may be as simple as early-binding the HACL or flipping over a single network setting; or, it can be as complicated as integrating this code with an automated web-scraper built from scratch with JavaScript.
(Because heavens forbid we actually change anything on the iSeries' backend to make everyone's lives easier).
Troubleshooting these situations, however, are beyond my current scope. Still, I invite the community at large to copy or extend these files with their own solutions regarding these issues.
[...]
[...]
When handling client-side I/O, the iSeries automation objects prefers the Long data type when handling numerical values.
To remain consistent, this class file does the same, even in cases where an integer value would be more intuitive.
IF YOU ARE USING MS ACCESS, please remember that True
in MS Access may not always be True
when used with other programs and languages.
I've lost quite a few hours to debugging Access's inexplicable ability to evaluate True = True
situations to False
when connecting to other programs.
Therefore, remember that these methods will pass "truthiness" directly from the AS400—and that any subsequent comparisons made in Access should be done with a defensive strategy in mind.
[...]
-
Encapsulate more methods
-
Move each automation object into their own class files
Den Temple | dentemple.io
This file is a refactor of IBM's Host Access Class Library (HACL). IBM provides documentation regarding the HACL here:
The transformative use of the HACL created by me is available for use under the MIT License.