Solved

How to access AS/400 files using Visual Basic

Posted on 2000-03-23
10
285 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
When rebooting a vCenters 6.0 and try to connect using vSphere Client we get this issue "Invalid URL: The hostname could not parsed." When we get this error we need to do some changes in the vCenter advanced settings to fix the issue.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

22 Experts available now in Live!

Get 1:1 Help Now