Thu, Jun
4 New Articles

Express Client Plays Monkey in the Middle

  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

IBM is enabling certain Express client functions—such as OLE DB, automation objects, and C/C++ APIs—as the middle tier in a three-tier client/server environment. Here’s how Express client can function as a “monkey in the middle” for products such as Microsoft’s Internet Information Server (IIS) and the Terminal Server Edition of Windows NT 4.0. If you’re looking for a way to leverage Express client over a network or the Internet (without installing the product on user desktops), this article is for you.

Although most people consider Client Access to be a set of client applications and APIs, a quiet evolution has been occurring over the last few releases of Client Access for Windows 95/NT. Beginning with V3R1M3 of the Windows 95/NT client, Client Access has supported the use of ODBC running as a service on a Windows NT 4.0 server. This step was merely the first in enabling Client Access as middle-tier software for your three- tier client/server network. With its new 32-bit Windows client, AS/400 Client Access Express for Windows (Express client), IBM is changing the way you network, allowing your network users (and even your Internet users) to take advantage of Express client’s functionality without having to load the product on their computers.

When IBM designed Express client, one of its design goals was to provide multiuser and three-tier environment support for network users. Redesigning Express client’s core processes allowed more parts of the program to run as NT services, enabling multiple users with different communications characteristics to run a single copy of Express client on the same machine.

In this article, we discuss how to use Express client in a three-tier environment and how your shop can benefit from this exciting new feature. We provide an overview of how Express client functions in the three-tier environment and how to use it as a service for importing data via Express client into Web pages using Microsoft’s Internet Information Server (IIS). We also detail how to use it in a thin-client environment that uses Microsoft’s Transaction Server (MTS) and Windows NT 4.0 Terminal Server Edition. You’ll see that Express client is more than a single-user solution and that IBM’s new product can function as a sort of monkey in the middle by delivering Express client services to networked clients. (Also, be sure to check out the references at the end of the article for more detailed information on how to deploy these techniques in your environment).

Express Client in a Three-tier Environment

Before exploring how to use Express client in a three-tier environment, you need some basic definitions, particularly those outlining what a three-tier application encompasses. All three-tier applications consist of the following layers:

Presentation layer (client tier). This layer presents the user interface for displaying and manipulating data. It may be a Web browser running on an IBM Network Station or a custom-built application that uses a remote component. Express client is not used in the client tier.

Business logic (middle tier). This layer contains the application logic. For the purposes of this article, the middle tier consists of a remote component or a Microsoft Active Server Pages (ASP) script running on a Windows NT 4.0 server. You install Express client on your Windows NT 4.0 server, and then remote or network users can access AS/400 services.

Services (database tier). This layer typically is data stored in DB2/400. You can access other AS/400 services through various host server programs or through a custom- built AS/400 program.

The key to three-tier development is that each layer is independent of the other, allowing each layer to be isolated and run on a different computer. This article concentrates on using Client Access in the middle tier.

The Microsoft technologies found in the middle tier include the MTS and the IIS. IIS includes an ASP development environment that allows the execution of scripts and ActiveX components on the server. OLE DB, ActiveX Data Objects (ADO), and Remote Data Service (RDS) are the technologies Microsoft currently recommends for accessing data from a middle-tier component. Figure 1 shows where Client Access fits into an IIS environment with ASP and ADO. Refer to the references listed at the end of the article for further information on Microsoft three-tier technologies.

Express Client Three-tier Techniques

Express client provides a variety of technologies that allow a Windows NT middle- tier component to fully access the power of the AS/400, including the following:

• Express OLE DB provider
• Express ODBC driver
• ActiveX automation objects
• Express C/C++ APIs With Express client, the AS/400 OLE DB provider now supports four different DB2/400 access methods in a three-tier environment:

• Record-level access
• SQL and stored procedures
• Remote commands and distributed program calls
• Data queues Most applications and components access the Express client OLE DB provider indirectly through ADO. The use of ADO and Express client OLE DB provides a simple, consistent interface to AS/400 services regardless of how the data is stored. You can use the same programming techniques, with only a few minor changes, to access AS/400 programs, data queues, commands, SQL queries, stored procedures, and physical and logical files. ADO and OLE DB also provide automatic data conversions between the AS/400 and PC data types. Support for record-level file access allows for more efficient data access when you don’t need the full power (and overhead) of SQL. The AS/400 OLE DB provider also offers what is perhaps the easiest technology for building three-tier applications. Figure 2 shows how the Express client OLE DB provider interfaces to the AS/400.

In addition, you can access the Express client ODBC driver through ADO by using the Microsoft OLE DB provider for ODBC (MSDASQL). Also, you can use the Express ODBC driver with RDS because RDS accesses data through MSDASQL. The Express

client ODBC driver provides enhanced SQL functionality compared to the Express client OLE DB provider. If you need functions such as updateable cursors, SQL commitment control, or stored procedure multiple result sets, then use the ODBC driver rather than the OLE DB provider. The other primary advantage of using ADO/ODBC over the native OLE DB provider is that ODBC allows connection pooling. In a typical MTS or ASP application, each client request generates a connect/disconnect to the AS/400. The overhead associated with the AS/400 job startup often is more than that of the actual request. ODBC connection pooling solves this problem by managing a “pool” of persistent connections, which provides a significant performance advantage over any other access method discussed in this article. Be aware, however, that at the time this article was written, testing of ODBC connection pooling had just begun. Official support for connection pooling in Express client will not be announced until after this testing has been completed.

Express client also includes a library of new, enhanced ActiveX automation objects. These objects provide access to AS/400 data queues, remote commands and distributed program calls, administration objects, and AS/400 system objects. You can use all of these objects in middle-tier development. Note that the original Windows 95/NT client automation library is still included with Express client. The original automation objects, including the database automation objects, were not revised and should not be used in a three-tier environment.

Automation Objects, ADO, or C/C++ APIs?

Is it better to use the automation objects or ADO? That depends. The first thing to consider is the object model. Visual Basic developers may be more familiar with the ADO object model, but experienced Client Access API developers may prefer the Express client object model. As discussed previously, the ADO object model imposes a consistent view of the data however that data is stored. This feature is ADO’s greatest strength, but also its greatest limitation. The “one size fits all” object model does not allow applications to fully tap the power of AS/400 services. In contrast, the Express client object model provides some functions not available with ADO, such as enhanced data queue function and enhanced parameter passing for AS/400 programs. In general, automation objects offer more functionality and greater flexibility at the expense of a few more lines of code.

You can use the Client Access C/C++ APIs in a three-tier environment as well. Typically, you use these APIs in custom-built business components written in C or C++. The Client Access APIs provide fast, low-level access to AS/400 host servers, but using them in a three-tier environment has several disadvantages. Programmers must have experience working with C APIs and data types, and programmers also need to account for thread-safety issues when creating their components. Only experienced C/C++ developers should use these APIs.

Express Client Middle-tier Development Guidelines

When developing Express client middle-tier components, you need to follow a few guidelines. First, middle-tier components cannot have a user interface. To prevent Express client from displaying AS/400 sign-on information, three-tier developers must properly use a new AS/400 system object. The AS/400 system object allows a user to specify all the information required to connect to a specific AS/400. It also has a new property, PromptMode, that allows programmers to specify how sign-on requests should be handled. This property must be set to cwbcoPromptNever or the three-tier application may appear to hang. OLE DB and ODBC do not allow direct access to the system object. However, both API sets include APIs that provide similar function.

Three-tier Express client testing has focused on using Express client and ASP scripts. No specific testing has been done yet with Express client and MTS. The same Express client technologies discussed for use with IIS should also work in MTS components, but remember that MTS components that use Express client functions must have their transaction property set to “Does not support transactions.”

Client Access in a Multiuser Environment

Another environment that puts Express client in the middle is the use of Microsoft’s Windows NT 4.0 Terminal Server Edition (TSE). TSE is a multiuser version of Windows NT 4.0 that allows multiple, simultaneous client sessions to be run on a single NT 4.0 server. One of the advantages of this platform is that the end users don’t need to be on PCs or even use a Windows operating system. TSE supports the connection of network stations, UNIX, Macintosh, DOS, OS/2, and other types of workstations. This support allows Express client functionality to be available to more users. Express client is installed only on the TSE, but all attached users can use Express client functions as if they were installed on their local workstations. Figure 3 shows the difference between using Express client on an NT server for multiuser use as opposed to three-tier use.

Before deciding if TSE is the right direction for your company, you need to consider the associated costs. If the client workstations are PCs running Windows 95, 98, or NT 4.0, then you need a TSE license on the server and a Client Access license and Windows desktop license per client. However, if you are using something else, such as network stations, then you have to purchase additional licenses for Citrix MetaFrame. This can add significant costs to your installations, depending on the number of users. If the client workstation is using an X-Windows-based (X.11) protocol, you also need a different software package called WinCenter for MetaFrame, which is available from Network Computing Devices (NCD).

Express Client Licensing

Regarding multiuser use, people usually ask about Express client licensing. Express client is sold based on the concurrent number of users communicating to the AS/400 simultaneously. For example, if you have 50 users but only 25 users might access an AS/400 at the same time, then you need to purchase only 25 licenses. This same principle applies when using three-tier environments. You need a Client Access license for each user who may simultaneously be accessing the same AS/400.

Also, be aware that the Express client ships at no additional charge with OS/400 V4R4, and you can use all Express client functions without a license except for PC5250

and Data Transfer, which require an Express client license for each concurrent user. So, if your users are using only ODBC and OLE DB tasks, they may not need to purchase Client Access Family for Windows (5769-XW1), which may make your Express client DB2/400 access more cost-efficient.

Other Express Client Factors in a Three-tier Environment

Given the new three-tier options available, what other factors should you consider when deciding between a three-tier connection and a direct connection between your Express client machine and the AS/400? Overall, we recommend you look at the following considerations:

What types of workstations are your employees using? Workstation choice is an important consideration. The Express client runs only on 32-bit Windows PCs. If you wish to use IBM Network Stations or do not wish to manage a variety of client software, then a three-tier choice might be right for you.

How critical is performance? If performance is your primary concern, a direct connection from the PC to the AS/400 is usually the best choice. Anytime you introduce a third layer, the network receives increased data flows. But, if your end-user machines are underpowered and you have a middle-tier server loaded with memory and disk (and you don’t have too many end users), then a three-tier environment might perform better.

What are your security needs? Security considerations have to do with the number of places you need to sign on from, cache passwords at, and maybe store digital certificates (if you use encryption). Because three-tier applications require no prompting for user IDs and passwords, these items need to be hard-coded or preconfigured into applications running in the middle tier. If you are running Secure Sockets Layer (SSL), look at your digital certificate needs and your needs for transferring them to different workstations in the network.

Where will the critical points of failure be in your network? If continuous uptime is a priority, consider where your critical network failure points are. A gateway PC server is likely to experience more downtime than an AS/400, so, if all of your client-to-server communications flow through a PC server, be aware that this could be your weakest link.

How much do you want to spend? Different networking solutions have different implementation costs, depending on the factors involved. When considering a TSE solution, you may be able to cut workstation costs by purchasing inexpensive network computers, but you need to pay extra licensing fees for the TSE software and for the Citrix MetaFrame software. For other three-tier solutions, in which your end users have Windows PCs, consider the additional cost of purchasing and administering a PC server box, which wouldn’t be required with a direct-connected two-tier solution. A three-tier solution enables you to offload processing normally done on a client PC, which can save you money in client hardware needed. But can you save enough to make up the cost of the extra PC server that you have to buy and maintain? That depends on the number of end- user PCs and whether those users need to run other applications that require more processing power, such as Microsoft Excel or Microsoft Access. You may not be saving on the cost of the PCs but actually spending more money on bigger PCs as well as purchasing more PCs to act as gateways.

A Whole New Set of Options

The addition of the Client Access Express for Windows client now gives customers more options in how to access data on their AS/400s. This product is better enabled than previous Client Access clients for three-tier networks, including IIS and TSE environments, so you need to consider a number of different factors in determining how to set up your network. You can run an NT server as your Web server by using the AS/400 primarily as a database, or you can do all of your Web serving on your AS/400 and possibly save some money. You need to look at what your priorities are and make decisions based on those priorities.

Related Reading

A Fast Path to AS/400 Client Server Using AS/400 OLE DB Support, Redbook (SG24-5183), www.redbooks.ibm.com

Citrix MetaFrame Web site: www.citrix.com/products/metaframe.asp Client Access Microsoft NT Server Web site: www.microsoft.com/ ntserver/web Microsoft NT Server Terminal Server Web site: www.microsoft.com/ntserver/terminalserver

“Microsoft Windows NT Server 4.0, Terminal Server Edition,” IBM APAR# II11373, www.as400.ibm.com/clientaccess/caiixd1.htm

OLE DB Web site: www.as400.ibm.com/clientaccess/oledb “Running Client Access ODBC as an NT Service,”Client Access/400 Expert, September/October 1998

“Web Publishing with the Client Access ODBC Driver and IIS,” IBM Technical Studio document, www.as400.ibm.com/clientaccess/iismain.htm

Basic Three-tier Application Using ADO and ASP

Any Browser


Client Tier

Express_Client_Plays_Monkey_in_the_Middle06-01.png 102x125

Client browser requests an Active Server Page

HTML sent back to the browser during execution of the ASP.


ASP application level variables

ASP session level variables

CA/400 is used in the middle- tier component to access AS/400 services

AS/400 programs stored procedures and data queues

Active Server Page

ASP Script

Port 3

Figure 1: The basic three-tier application architecture uses ADO and ASP.

Database tier


Express_Client_Plays_Monkey_in_the_Middle06-02.png 162x208

ActiveX Custom Business Component CA/400 OLE/DB API ODBC

ActiveX Data Objects Instantiated during the ASP file execution

Express_Client_Plays_Monkey_in_the_Middle06-00.png 327x95

Middle Tier

Runtime support


Express_Client_Plays_Monkey_in_the_Middle07-00.png 97x112

Any OLE-compliant tool (Visual Basic, Delphi, etc.)

ActiveX Data Objects and controls (ADO, ActiveX controls)

OLE DB layer (COM)

Database Program/command Data queues SQL Stored procedures


Express_Client_Plays_Monkey_in_the_Middle07-01.png 81x104

OS/400 host servers

Command processor DDM/DRDA server


procedures AS/400 program

Data queues SQL processor

Figure 2: This is how Client Access OLE DB support works.


ODBC Server app

ODBC Server app

Diagram of Multiuser vs. Three-tier

Express_Client_Plays_Monkey_in_the_Middle07-02.png 131x189


ODBC Server app Network










Express_Client_Plays_Monkey_in_the_Middle07-03.png 131x189

ODBC Server app

Figure 3: Multiuser support is different than three-tier client support.



Support MC Press Online

$0.00 Raised:

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: