Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How could a VB application connect directly to AS400 through IP addres

Status
Not open for further replies.

ladeecroft

Programmer
Oct 6, 2003
19
PH
HI there!

Just wanna ask if you have any idea how I could send a request from my VB application directly to AS400 application program just by using IP address?

I've tried using ODBC through Client Access driver and it worked but directly accessing AS400 files is very risky.

I've also tried using AS400 PC folder and performed FTP from time to time to check if there's a request from my VB application that needs to be processed in my AS400 application. This also worked, but using an AS400 PC folder would mean granting access to all workstation to that folder.

I've run out of ideas on how i could process the request from a VB application to an AS400 application using RPG and CL language...hope you could give me some input.

thanks!
 
Yes, you can send IP packets from a VB program to an AS400 using the TCP/UDP control that is available. The trick is knowing what format you must use to communicate with the AS400. The other challenge is that the AS400 is most likely going to use an EBCDIC format to communicate vs the ASCII format that most other systems use.

The first step in embarking on such a project is to get a good packet capture of a successful conversation with the AS400. From this capture, you can see how the the client is communicating with the AS400.

Mike
 
If you are looking for the proper control, it is the Winsock (Windows Sockets). It will handle the TCP/IP portion of the communication for you, like the ODBC client does. You just have to get the packet content formatted correctly.

You might be able to find a software driver or hardware board that can do TN3270 emulation (which should take care of your ASCII to EBCIDIC problem). I think that WRQ's Reflection can handle that for you, and it can be used as an ActiveX control, so you would be able to program to it in VB.


pansophic
 
Thanks for the reply. I've checked our AS400, it's using Telnet to communicate through Client Access with 5250 emulator.

I've seen codes that have used winsock control but i still dont have any idea on how this control could communicate (send and receive data) to AS400 just by defining the Remote Host and its corresponding port. Is it through the socket? Do you think i still need to create a socket server program?

In AS400, i've seen an application program that receives a parameter from the front end. This application program is triggered everytime the Finance job is submitted to batch (SBMFNCJOB). This CL command uses a device table and a program table. And all the request from the devices specified in the device table are received by this application program specified in the Program table. I understand what happens once the application pgm is triggered, what i dont get is how does it receives the requests from the front end (front end is using Consumer Transaction (CT)language).Based on what you've said, it's possible for VB to connect to AS400, sytem to system..how do i do this?

Im really confused, it's too technical for me. Hope to hear more from u guys.I really could use some help from tech guys.



 
thanks mike and pansophic!

i just have one more question, what do u mean by "getting a good packet capture"..i'm sorry but i'm not into technical terms, so those terms are kinda new for me.

pls enlighten me. thanks!
 
You create a Winsock client application if you have a listening port on the AS/400 that you want to connect to. If you want the AS/400 to connect to your computer when it has some data, then you need to create a server app.

It is really just a question of whether you want your application to listen for a connection request or not.

As I recall, there were some very self explanatory client and server apps on the MSDN disk. Just do a search in Help for Winsock.

By a good packet capture we mean to run an application like ethereal, and connect to the AS/400 as you normally would. What ethereal captures will give you insight into the data and session formats. This is especially important when you are creating cross platform applications, as there may be data manipulation that occurs (like the ASCII to EBCIDIC conversion).


pansophic
 
You can use the WinSock control that comes with VB, but there are easier ways to do it if the communication between the AS/400 and the workstation uses Telnet. One way is to use some of the custom controls from Distinct. Here is a link to the Telnet control.


I have used the SNMP and SMTP controls many times and they make programming TCP and UDP connections very easy.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top