Solved

How to access AS/400 files using Visual Basic

Posted on 2000-03-23
10
284 Views
Last Modified: 2008-02-01
I have tried to access files on the AS/400 using Visual Basic and ADO, but with no success.

I am using the following: Client Access V3R2M0, OS/400 V4R4M0, Windows NT 4.0, and Visual Basic 6.0 (SP3).

Any help would be greatly appreciated.
0
Comment
Question by:jshattuck
10 Comments
 
LVL 3

Expert Comment

by:P_S_Price
ID: 2649754
Why not Use ODBC through the VN Access engine
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2650297
Surely if you can use ODBC you can use ADO also.

Just to eliminate all other possibilities, you can successfully use ADO to access something else, e.g. an Access database?
0
 

Expert Comment

by:TGB
ID: 2653660
We're running NS Administrator, with NT 4.0 .... and to access files on the 400 from within VB we have to use ICF files to handle the transfer of data between VB6.0 and the 400.
This needs an RPG program to get the data from the files, and then pass it to the PC through the ICF file. The VB program then retrieves this data and does what you want with it. Writing any data back to the 400 is handled the same way, but in reverse ;)
If you want any more info on this method, get in touch.... hope this helps.
0
 
LVL 7

Expert Comment

by:twol
ID: 2662162
Is your ado connection working okay?
If so then make sure you are using a client side cursor. We're accessing fine. But when you use a host cursor, sometimes the record count will be -1.
0
 
LVL 3

Expert Comment

by:jetforce
ID: 2672580
I have not used Client Access for a very very very long time, I have no trouble accessing the AS400 using RUMBA ODBC drivers, I would imagine this would be the same way except for the dsn. Try something like this

Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

conn.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;Extended Properties='DSN=AS400;';Initial Catalog=S44F1966"
  conn.CursorLocation = adUseClient
  conn.Open , "Username", "PASSWORD"

Set rs.ActiveConnection = conn
rs.CursorType = adOpenForwardOnly
rs.CursorLocation = adUseClient

rs.Open "Select * from ALibrary/ATable"


PS your library and table might need seperating by . instead of /.

Also make sure you have created your dsn

Cheers
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Expert Comment

by:Nelmarcas
ID: 2686062
Why don't you use Client Acess Express V4R4?  
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 2762880
what protocol are you using? if tcp/ip i dont think it is supported with icf.  you will need to use the appc protocol.  or i believe if you have a product such as Netsoft router to allow the vb appc routine to work with the tcp/ip connection
0
 

Accepted Solution

by:
Hezi earned 200 total points
ID: 2772806
If you use
Client Acess Express V4R4,
You can use ADO and OLEDB, Best features.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6401614
This question was LOCKED with a PROPOSED ANSWER and awaits your decision today.  Once a question is LOCKED with a Proposed Answer, few new experts will step in to help on that question, since the assumption is, you've been helped.  If the Proposed Answer helped you, please accept it and award that expert.  If it did not help you, please reject it and add comments as to status and what else is needed.
 
If you wish to award multiple experts, just comment here with detail, I'll respond as soon as possible.  As it stands today, you asked the question, got help and not one expert was awarded for the contribution(s) made.  Your response is needed.  I'll monitor through month end, and if you've not returned to complete this, we'll need to decide.  Expert input is welcome (as always) to determine the outcome here if the Asker does not respond.
 
Your response in finalizing this (and ALL) your question(s) is appreciated.
 
Moondancer
Community Support Moderator @ Experts Exchange

0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6890909
ZERO reponse to my request above;  therefore finalized today by EE Moderator.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Find out what Office 365 Transport Rules are, how they work and their limitations managing Office 365 signatures.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now