ActiveX AS/400 Objects - Overview
- ActiveX AS400 Objects Out of Process Server is registered within the Microsoft
Windows registry during setup process. If required, use regsvr32 to register
AS4x241.exe manually.
- Run-time registry settings exist to retain settings and are located at:
HKEY_LOCAL_MACHINE\Software\CMI\ActiveX_AS400_Objects
- This object provides a simplified access to IBM Client Access/400 dynamic link libraries
including cwbDQ.dll, cwbOBJ.dll and cwbDB.dll. This object has been run on CA/400 for
Windows 95/NT V3R1M3 with service pack SF5xxxx installed. IBM service packs have corrected
minor problems in the operation of this object.
- Many IBM CA/400 function calls require strictly enforced memory allocation and type
checking. This object encapsulates these DLL requirements and simplifies their use. EBCDIC
to ASCII and EBCDIC to ASCII conversion is automatically performed, but may be overridden
if desired.
- This object contains classes. Classes can be referenced within VB, VBA and
VBScript applications. Macros, script and application code can reference the
classes contained within this object. This object contains the following classes:
| Name |
Overview description |
| Command |
Executes native AS/400 commands. |
| Communications |
CA/400 environment and connection values and status. |
| DataQ |
Contains native AS/400 data queue support. |
| Program |
Calls native AS/400 programs with support for parameters. |
| ProgramParm |
Contents of a single program parameter. See
note. |
| ProgramParms |
Contents of all program parameters. See note. |
| Spoolfile |
Relates to a single native AS/400 spoolfile. |
| Spoolfiles |
Relates to a list of native AS/400 spoolfiles. |
| SQL |
Executes read-only DB2/400 compliant data retrieval. |
| SQLColumn |
Contents of a single column in record retrieval. See note. |
| SQLColumns |
Contents of all columns in recordset retrieval. See note. |
| StatusWindow |
User supplied logging and message display. |
Note on ProgramParms, ProgramParm, SQLColumns and
SQLColumn:
These classes are defined as 'public not creatable' classes by design. They are made
public for type definition only. These classes are created through Program and SQL
classes.
- Classes contain properties and methods that pertain to design and logic. Each class can
be referenced within ActiveX compliant applications such as Microsoft Access, Word, Excel
and Active Server Pages. VB and VBA applications must first reference this object before
execution. See application documentation for object referencing information. Many
applications have similar coding syntax therefore the following coding examples are
provided here:
Visual Basic, VBA
Dim oDQ As ActiveX_AS400.DataQ
Dim sDQRecv as string
Set oDQ = new ActiveX_AS400.DataQ
oDQ.LibraryName = "QGPL"
oDQ.QueueName = "TESTDQ"
oDQ.WaitTime = 1 'second
sDQRecv = oDQ.ReadQ
Active Server Pages
Dim oDQ
Dim sDQRecv
Set oDQ = Server.CreateObject("ActiveX_AS400.DataQ")
oDQ.LibraryName = "QGPL"
oDQ.QueueName = "TESTDQ"
oDQ.WaitTime = 1 'second
sDQRecv = oDQ.ReadQ
- Each class contains one or more properties. Each property contains a value
of information or status indication. Some values can be modified and some
are read-only. Properties all have a data type.
- Methods execute internal routines and may return a value. Many methods require
passing of parameter variables. Many do not. Some methods support optional
parameters allowing for ease and personal preferences. Methods that return
a value all have a data type.
- Types are numeric, date, alphanumeric or boolean (true or false) values. All types
defined within this object are Visual Basic data types. Numeric types include Integer,
Long, Double, Currency and Date. Alphanumeric type is simply a variable length ANSI
string. Boolean types are provided for logic and status flags.
- On Windows NT Server, DCOMCNFG can be run to require operating system to
launch this object as the interactive user. Windows services such as IIS require
this override to provide for interactive AS/400 logons and object status displays.
| 2003
- Chouinard & Myhre, Inc. |