|
|
![]() |
|
|
The Client Access Express Toolkit by Shannon O'Donnell Have you ever needed to write applications for a PC so that it could communicate with your AS/400? Perhaps you needed to query an AS/400 database and display it in a PC-based application. Or maybe you needed to send and receive data from the AS/400 to the PC via automated FTP. Whatever you need to do, chances are good that IBM has anticipated your needs and created tools to help you solve such problems. Check out the Client Access Express Toolkit!
The Toolkit The Express Toolkit is a free component of Client Access Express. You can install it by using the Selective Installation program that comes with Client Access Express. Once the Toolkit has been installed, you can navigate to it by clicking the Windows Start button, the IBM AS/400 Client Access Express menu item, and then the Express Toolkit menu item. You'll be presented with a screen displaying a tree list of Client Access Express Toolkit topics. Clicking any of the tree items will display sub-items for the selected category. Clicking the sub-items will display semi-detailed help for each item. Each topic is then broken down into the various programming tools and languages that the topic applies to. Clicking the Database tree item, for example, uncovers entries for ActiveX, ADO/OLE DB, C/C++ APIs, Java, JDBC, and ODBC. Clicking the ActiveX sub-item will display a short help screen that tells you a little bit about the Database ActiveX objects available to you with Client Access Express. The information displayed in the help panel isn't terribly useful, but most help panels also contain a link back to IBM's Web site, where you can find dozens of code examples that show how to use the given object. In fact, you can save yourself some time by going directly to IBM's Client Access Express Toolkit Web site. From there, you can navigate through the various topics and code samples. A ToolKit Example So what can you do with the information you find on the Web site or in the Toolkit documentation? Plenty! You can find code samples for making Visual Basic, C++, Java, Microsoft Access, and other applications communicate seamlessly with the AS/400. And that's pretty cool! Any programmer who has ever tried to communicate with some of the proprietary AS/400 objects, such as data queues and libraries, using standard Java or Windows APIs will really appreciate having a lot of the complexity wrapped up in easy-to-use controls and APIs. Let's take a look at an example of something you might use the Toolkit for. The following example, named UNWEBAPP.htm, was taken directly from the IBM Web site, under the Visual Basic Script section. This example demonstrates how to use the Client Access Express "List" and "Tree" ActiveX objects to display the Client Access Express Operations Navigator tree in a Web browser. Take a look at the HTML source for this sample. Surprisingly, it's very simple to understand. In fact, the only complex part of the code is inserting the ActiveX objects for the List and Tree controls into your HTML code. The nice thing about it, though, is that the most often needed properties for these ActiveX objects have been filled in for you in the sample, so if you want to use this code in your own HTML applications, simply copy and paste! Let's take a quick peek at the relevant portion of the HTML code that instantiates the Client Access Express Tree and List ActiveX controls:
<OBJECT ID="Tree1" WIDTH=300 HEIGHT=500 align= hspace=60
vspace=20
CLASSID="CLSID:D5BD7E23-00C4-11D0-B326-0004AC76C946"
CODEBASE="UNOCXTL.OCX">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="7408">
<PARAM NAME="_ExtentY" VALUE="10583">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
<OBJECT ID="List1" WIDTH=500 HEIGHT=500 hspace=60
vspace=20
CLASSID="CLSID:D5BD7E27-00C4-11D0-B326-0004AC76C946">
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="7408">
<PARAM NAME="_ExtentY" VALUE="10583">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
In the above code, the first grouping specifies that the Operations Navigator Tree control will be used, and a few of the most common properties are set, including the CCSID and the initial size of the tree that will be displayed. In the second code grouping, the Client Access List control is instantiated and, again, a few of the most common property values are set. Note that the Tree and List controls are automatically installed on your PC when you install Client Access Express. Although this is not an article on VBScript or using ActiveX objects in HTML, you can quickly see how useful the code sample shown here might be in your own applications. Go Exploring Take a look at the Client Access Express Toolkit or the IBM Web site. Explore. See what's available to you. There's a surprising amount of code out there that can be used in everything from simple HTML to very complex and robust Java and Visual Basic applications. If you are an AS/400 programmer who has been tasked with making your PC applications talk to your AS/400 host, you owe it to yourself to check out the Toolkit. Take it from someone who has wasted hours figuring out the hard way how to do something. Checking the Toolkit first can save you days of programming!
|
Editors
Contact the Editors |
|
Last Updated: 10/10/02 Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |