IBM Support

IBM i Access for Windows Toolkit - All samples


The following is a complete list of all available sample programs for developing applications which use IBM i Access for Windows.

  • adsamp1.exe – Demonstrates correct method to determine the version and release of iSeries Access for Windows on the PC.

    This sample illustrates the correct method to determine the version and release of IBM i Access for Windows. This method will return valid values for any release of IBM i Access for Windows 95/NT and also IBM i Access. The sample is written in C++ and has no MFC dependencies.

  • coconsce.exe – Use of Communications System Object APIs in various connection scenarios.

    This sample demonstrates how an application might use the IBM i Access for Windows Communication APIs related to System Objects. In this example, these APIs are used to create system objects and to set their attributes according to the security and performance requirements of various scenarios. The system objects are then used to run remote commands (using the Remote Command APIs and Service APIs) and to validate user IDs and passwords, and the behavior and some elapsed times can be observed by the user.

  • cogetsys.exe – Demonstrates the use of Communications APIs.

    This module is used to demonstrate how an application might use the Communication APIs. In this example, these APIs are used to get and display the list of all configured systems. The user can choose either to be shown all of a system's connection properties (the attributes of the created system object), or to have the ability to connect to all IBM i Access for Windows systems checked. APIs that deal with the System List as well as APIs that deal with individual System Objects are used.

  • convsamp.exe – Sample using the cwbNL_ConvertCodePages API to perform code page conversion on files.

    This sample demonstrates how an application might use the cwbNL_ConvertCodePages to convert files between ASCII and EBCDIC.

    The sample expects four parameters:

    1. source file name
    2. source code page
    3. target file name
    4. target code page

    The sample reads the source file, converts it from the source code page to the target code page, and saves the result to the target file.

  • d_allobj.exe – Delphi 4 sample using the IBM i Access for Windows automation objects.

    This Delphi 4 sample uses the IBM i Access for Windows automation objects to perform the following:

    • Retrieve the list of IBM i systems which have previously been connected
    • Specify a new IBM i system to access
    • Retrieve information about an IBM i, such as the: IP address, host version and release levels, password expiration date, number of active connections, etc.
    • Call an IBM i Access for Windows API to retrieve a list of user libraries on the system
    • Call an IBM i API to retrieve a list of data queues in a library
    • Create and delete libraries
    • Create and delete data queues
    • Query the attributes of data queues
    • Send and receive data using data queues
    • Convert strings and numeric data between host and PC formats
    • Retrieve information about the IBM i Access for Windows code installed on the PC
  • dbapisp1.exe – C programs that demonstrate use of the Database APIs (also referred to as Optimized SQL APIs).

    This is a group of small C programs that demonstrate the use of all three categories of database APIs--Catalog, SQL, and Native Database--to do the following:

    • Retrieve information about objects (libraries, files, fields, etc).
    • Create a file, override members and use block insert to put records into the different members.
    • Add a library to the user's library list, get a library list and step through it, and look for a library on the system.
    • Use SQL APIs to query a database table.
  • dirupdat.exe – C/C++ sample program showing a simple example of setting up Directory Update entries.

    This C/C++ sample program demonstrates creating, configuring, and deleting Directory Update entries. A "Create Update Entry" interface is included, where the required options of an update entry are gathered. This code path calls Directory Update APIs to create the update entry, and an API to set the attributes of the update entry. A "Delete Update Entry" interface is also included. This code path calls the Directory Update APIs necessary to delete an update entry.

    It should be noted that the Directory Update APIs only set up the update entries to be used by the Directory Update application. The Directory Update APIs do not perform the file updates that result from the update entries. The Directory Update application performs the actual update function.

    For more detail on Directory Update, and package file support, read the IBM i Access for Windows User's Guide (that is installed on your PC when IBM i Access for Windows is installed).

  • dqrmtcm2.exe – Sample using ActiveX controls and automation objects for data queues and remote command.

    This Visual Basic sample uses the IBM i Access for Windows ActiveX custom controls and automation objects to retrieve a list of IBM i systems (which have been previously connected), create and delete libraries, create and delete data queues, and send and receive data using data queues.

  • dqsamp.exe – Data queue sample written in Visual C++ 4.2 using MFC and the Data Queue APIs.

    This sample uses the IBM i Access for Windows Data Queue APIs to do simple client/system transaction processing and keyed storage. The interface uses the Microsoft Foundation Classes (MFC) for displaying graphical dialogs, storage objects, and for Windows message processing. The code that does the actual data queue operations consists of a set of classes which call the Data Queue APIs.

    Two separate types of data queues are used in the sample. A First-In First-Out (FIFO) queue for transaction messages and a keyed queue for item storage. These queues may reside on different systems.

  • hllsmp.exe – C sample using the PC5250 Emulation EHLLAPI interface.

    This sample shows how to request keystrokes and log on to a IBM i, using the PC5250 EHLLAPI interface.

  • logtrace.exe – Sample program showing usage of the IBM i Access for Windows service log and trace APIs.

    This module is used to demonstrate how an application might use the IBM i Access for Windows Serviceability APIs. In this example, these APIs are used to log a message to the history log, and log trace points to the detail trace file.

  • lstjobx.exe – Display a list of jobs using the System Object Access APIs.

    This program uses the System Object Access APIs to display a list of jobs. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the jobs in the list.

  • lstmsgx.exe – Display a list of messages using the System Object Access APIs.

    This program uses the System Object Access APIs to display a list of messages. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the messages in the list.

  • lstprtx.exe – Display a list of printers using the System Object Access APIs.

    This program uses the System Object Access APIs to display a list of printers. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the printers in the list.

  • lstsplfx.exe – Display a list of spooled files using the System Object Access APIs.

    This program uses the System Object Access APIs to display a list of spooled files. The list is displayed in a "spreadsheet" form allowing the user to perform actions on the spooled files in the list.

  • odbcsmpl.exe – C Sample Program using the IBM i Access for Windows ODBC Driver.

    This code demonstrates how to use the IBM i Access for Windows ODBC Driver to perform basic SQL tasks, including:

    • creating a table
    • inserting records into a table
    • retrieving a table name
    • retrieving a column name
    • retrieving rows from a table
    • dropping a table
  • pcsmain.exe – C sample using the PC5250 Emulation PCSAPI interface.

    PCSMAIN provides a sample dialog that allows you to start, stop connect, and disconnect PC5250 sessions, and perform a simple query to determine the session status as well as to find out what .ws is associated with the session.

  • printobj.exe – Sample using the system Object APIs to provide access to objects related to printing: printers, spooled files, output queues, etc.

    This sample, when compiled and linked with Microsoft Visual C++, will allow access to spooled files, output queues, writers, printer devices and lists of printer files and libraries. It generates a file named smplnpob.exe which can be run from a DOS command prompt. The source code for this sample provides coding examples which use the cwbOBJ_ set of iSeries Access for Windows APIs.

  • rcsamp1x.exe – Demonstrates the use of the Remote Program Call API.

    This sample demonstrates using the IBM i Access for Windows Remote Program Call APIs, National Language Support APIs, and the Service APIs to call an OS/400 API and return its output to the PC.

  • rcsamp2x.exe – Demonstrate the use of Run Comand API.

    This sample demonstrates using the IBM i Access for Windows Run Command API to call an OS/400 command and if an error occurs, retrieve message help for the error message.

  • usfsampl.exe – Demonstrates the use of the Ultimedia System Facilities (USF) APIs.

    This USF sample uses some of the USF APIs to perform the following:

    • Obtain an USF conversation
    • Release an USF conversation
    • Present an USF multimedia object
    • Present a multimedia file that is not imported into the USF multimedia system
    • Query USF objects with a specified attribute value.
    • Retrieve an USF object's attributes
  • vballobj.exe – Visual Basic sample using the iSeries Access for Windows automation objects.

    This Visual Basic sample uses the IBM i Access for Windows automation objects to perform the following:

    • Retrieve the list of System is which have previously been connected
    • Specify a new System i to access
    • Retrieve information about an System i, such as the: IP address, host version and release levels, password expiration date, number of active connections, etc.
    • Call an System i API to retrieve a list of user libraries on the system
    • Call an System i API to retrieve a list of data queues in a library
    • Create and delete libraries
    • Create and delete data queues
    • Query the attributes of data queues
    • Send and receive data using data queues
    • Convert strings and numeric data between host and PC formats
    • Retrieve information about the IBM i Access for Windows code installed on the PC
  • vbdbauto.exe – Visual Basic sample using the database automation objects.

    This Visual Basic samples uses the database automation objects to:

    • Download an IBM i database file to an ASCII text file or to the display
    • Upload an ASCII text file to an existing database file, by appending to the file or by replacing the contents of the file.

    The IBM i Access for Windows conversion objects are also used to convert the data between IBM i and PC formats.

    ** Note: This samples requires service pack SF57098 or later in order to run.

  • vbdtasyn.exe – Visual Basic sample using low-level Data Transfer download automation objects for asynchronous transfers.

    This Visual Basic sample uses the low-level Data Transfer automation objects to perform the following:

    • Asynchronously download data from an IBM i database file
    • Asynchronously upload data to an IBM i database file
    • Display the status of an active asynchronous upload or download request
    • Cancel an active asynchronous upload or download request

    After an asynchronous request is submitted, control is immediately returned to the application without waiting for the transfer to complete. To verify this, you can clear the status list while the request is running.

    For additional sample code that demonstrates how to use the low-level Data Transfer automation objects, see the examples in the online help. To access this file, go to the Start menu and choose Programs -> IBM AS/400 IBM i Access for Windows -> IBM i Access for Windows Toolkit -> IBM i Access for Windows Toolkit -> Database -> ActiveX -> IBM i Access for Windows ActiveX Automation Objects - data transfer.

    This function is initially available in IBM i Access for Windows V5R1M0.

  • vbdtdlr.exe – Visual Basic sample using low-level Data Transfer download automation object.

    This Visual Basic sample uses the low-level Data Transfer download automation object to perform the following:

    • Download data from an IBM i database file
    • Customize how the data will be returned, through the setting of PC file type-specific properties
    • Customize the query to be performed using either Data Transfer or SQL syntax
    • Specify which user ID and password should be used for the transfer
    • Save a download transfer request which can be used from the high-level automation object, the low-level automation object, the batch Data Transfer application or the interactive Data Transfer application.
    • Load a previously saved Data Transfer download request and use its settings to transfer data using the low-level download automation object. The request could have been created using an ActiveX automation object or the Data Transfer application.

    For addition sample code, demonstrating how to use the low-level Data Transfer download automation object, see the examples in the online help. To access this file, go to the Start menu and choose Programs -> IBM AS/400 IBM i Access for Windows -> IBM i Access for Windows Toolkit -> IBM i Access for Windows Toolkit -> Database -> ActiveX -> IBM i Access for Windows ActiveX Automation Objects - data transfer.

    This function is initially available in IBM i Access for Windows V5R1M0.

  • vbdtdxfr.exe – Visual Basic sample using high-level Data Transfer download automation object.

    This Visual Basic sample uses the high-level Data Transfer automation object to perform the following:

    • Download data from an IBM i database file, using one line of code
    • Upload data to an IBM i database file, using one line of code
    • Run an existing Data Transfer request file
    • Specify user ID and password values to override the default security values when performing a database transfer

    For additional sample code that demonstrates how to use the high-level Data Transfer automation object, see the examples in the online help. To access this file, go to the Start menu and choose Programs -> IBM AS/400 iSeries Access for Windows -> iSeries Access for Windows Toolkit -> iSeries Access for Windows Toolkit -> Database -> ActiveX -> iSeries Access for Windows ActiveX Automation Objects - data transfer.

    This function is initially available in IBM i Access for Windows V5R1M0.

  • vbdtulr.exe – Visual Basic sample using low-level Data Transfer upload automation object.

    This Visual Basic sample uses the low-level Data Transfer upload automation object to perform the following:

    • Create a data file or a source file on an IBM i system
    • Append data to an existing IBM i data or source file
    • Save an upload transfer request which can be used from the high-level automation object, the low-level automation object, the batch Data Transfer application or the interactive Data Transfer application.

    For additional sample code that demonstrates how to use the low-level Data Transfer upload automation object, see the examples in the online help. To access this file, go to the Start menu and choose Programs -> IBM AS/400 iSeries Access for Windows -> iSeries Access for Windows Toolkit -> iSeries Access for Windows Toolkit -> Database -> ActiveX -> iSeries Access for Windows ActiveX Automation Objects - data transfer.

    This function is initially available in IBM i Access for Windows V5R1M0.

  • vbhllapi.exe – Visual Basic sample using the PC5250 Emulation EHLLAPI interface.

    This is a Visual Basic sample dialog that shows how the various EHLLAPI APIs work and the output that is generated by them. EHLLAPI APIs allow you to perform communication management, send keystrokes to a session, query information about the session and/or the presentation space, write to the presentation space, as well as many other functions.

  • vbpcsapi.exe – Visual Basic sample using the PC5250 Emulation PCSAPI interface.

    This Visual Basic sample program shows how to:

    • start and stop sessions
    • perform a query to determine the session status
    • determine which .ws file is associated with a session
  • vbsallob.exe – Visual Basic Script sample using the IBM i Access for Windows automation objects.

    This Visual Basic Script sample uses the IBM i Access for Windows automation objects to perform the following:

    • Retrieve the list of IBM i systems which have previously been connected
    • Specify a new IBM i to access
    • Retrieve information about an IBM i, such as the: IP address, host version and release levels, password expiration date, number of active connections, etc.
    • Call an IBM i API to retrieve a list of user libraries on the server
    • Call an IBM i API to retrieve a list of data queues in a library
    • Create and delete libraries
    • Create and delete data queues
    • Query the attributes of data queues
    • Send and receive data using data queues
    • Convert strings and numeric data between host and PC formats
    • Retrieve information about the IBM i Access for Windows code installed on the PC

    This sample requires the file cwbxvbs.inc which is installed in the Include directory as part of the IBM i Access for Windows Toolkit. This file must be in the same directory as the files from this sample.

    Note: If you get the following error while running this script:
    "ActiveX component can't create object: 'createobject'"
    please see Microsoft Knowledge Base article Q195826.

  • wdtsampx.exe – Sample program to show how to use the IBM i Access for Windows Data Translation API.

    This program allows the user to pick which translation should be executed from a standard Windows pull-down menu. For each type of translation there is a dialog box that will be displayed on the screen to allow the user to enter values to be translated. When the OK button is pressed, or the enter key is pressed with the cursor in the entry field, the translation will be performed and the results will be displayed. This process will continue until the Cancel button is pressed.

Document information

More support for: Power Systems

Version: Version Independent

Operating system(s): IBM i

Reference #: T1027174

Modified date: 28 March 2018


Translate this page: