Q
Problem solve Get help with specific problems with your technologies, process and projects.

Call an AS/400 stored procedure

How can I invoke a stored procedure that I create on DB2/AS/400 with RDO for Visual Basic 6.0 applications?

In order to call an AS/400 stored procedure via VB your best shut is using OLE DB provider. For example, the one provided by Client Access Express.

Steps:

1. Get mdac up and running -- This is the microsoft part.

2. Create the procedure on the AS/400 using one of the compilers (i.e rpg' cobol' c' pure sql).

3. Register the procedure using the create function as follows:

CREATE PROCEDURE QGPL.myproc
(parm1 OUT CHAR(10), parm2 OUT CHAR(10))
(EXTERNAL NAME QGPL.pgmname LANGUAGE CL SIMPLE CALL)

4. Embed the code for procedure call, an example can be found here:

ANE Classics: More AS/400 Client/Server Programming with ADO and VBA

It is easy and it works. Note that on the AS/400 your program will be called by an AS/400 host server with user name quser.


This was last published in March 2001

Dig Deeper on FTP

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close