AS400 Interface with VB using Dataqueue ActiveX

Posted on 2003-02-23
Medium Priority
Last Modified: 2012-08-14
 I just became a Member of the site today and have a big question.
 I am in a project which asks for the  AS400(V4R4)  to synchronously exchange data with VB(ActiveX).The project asks for massive Interactive data exchange between the 2 systems.The suggection is to use Dataqueue and ActiveX.
 Please guide me step by step about the process of establishing the connection and data transfer.
 All the suggestions and ways to do are most welcome

 Thanx in advance
 Amit Bagchi

Question by:amitbagchi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

FletcherTheCat earned 200 total points
ID: 8007045
Which version of Client Access are you using? You need (I think) at least 5.1 to have the Client Access ActiveX object library.

There are some examples for working with Data Queues via the ActiveX object library at:


Reading and writing from the VB side is quite straightforward... the following is a simple example of writing an entry and reading it back..

Sub DataQueueExample()

' Add a reference to IBM AS/400 Client Access Express
' ActiveX Object Library
' (C:\Program Files\IBM\Client Acccess\Shared\cwbx.dll

' Declare AS400 object
Dim oAS400 As cwbx.AS400System
' Declare Data Queue object
Dim oDTAQ As cwbx.DataQueue
' String objects for queue data
Dim sWriteString as String
Dim sReadString as String

' Create objects

Set oAS400 = New cwbx.AS400System
Set oDTAQ = New cwbx.DataQueue

' Define the AS400 by name - change value in quotes

' Supply user id and password for AS400
' Change values in quotes

oAS400.UserID = "USERID"
oAS400.Password = "PASSWORD"

' Connect to Data Queue Service
oAS400.Connect (cwbcoServiceDataQueues)

' Define Data Queue object - change values in quotes
oDTAQ.libraryName = "LIBRARY"
oDTAQ.queueName = "DATAQUEUE"

' Write an entry to the data queue

sWriteString = "I wrote this string"
oDTAQ.Write (sWriteString)

' Read an entry from the data queue
sReadString = oDTAQ.Read(0)

' sReadString will now contain "I wrote this string"

End Sub

On the AS400 side, so read and write from the data queues you will need to use the QSNDDTAQ and QRCVDTAQ APIs (QSNDDTAQ to write, QRCVDTAQ to read).

A couple of good examples for these APIs can be found at:



Author Comment

ID: 8014930
 The Client Access version we are using here is V4R4 and according to you to access Client Access ActiveX object library,I need to have V5R1.
 Now dear will V4R4 solve my purpose? I cannot ask the Client to upgrade at this point.
 Thanx a ton for the part about Reading and writing at VB end, and about sending me the URL for the required API's. But I am still at bay to find out what will get me thro with V4R4.
Please reply.
Thanx again for the response
Amit Bagchi

Author Comment

ID: 8250955
Thanx Fletcher n sorry for the very late reply.
Your suggestion was useful.
I managed to get the Interface with ADO.
Regards & Thanx agn
Amit Bagchi
LVL 33

Expert Comment

ID: 8993173
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept FletcherTheCat comment as answer

Please leave any comments here within the next seven days.


EE Cleanup Volunteer

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Check out the latest tech news, community articles, and expert highlights in August's newsletter.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month12 days, 13 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question