Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VBA Connection to AS400

Posted on 2007-11-16
7
Medium Priority
?
1,250 Views
Last Modified: 2013-11-27
I need to write a VBA Fuction on MS Access to connect to the AS400 database.

I am finding problems executing the script i have written in the module. Can you please write for me a proper code that will allow me to do the connection and also write another script to create an sql query in order to put the data in a record set.

0
Comment
Question by:ramimassoud
  • 4
  • 2
7 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 900 total points
ID: 20299061


  -- ODBC Driver for AS/400 (from IBM)

oConn.Open "Driver={Client Access ODBC Driver (32-bit)};" & _
           "System=myAS400;" & _
           "Uid=myUsername;" & _
           "Pwd=myPassword"

0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20299091
post the codes that you have written ...
0
 
LVL 1

Author Comment

by:ramimassoud
ID: 20299123
the MyAS400 <- Stands for what?
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 1

Author Comment

by:ramimassoud
ID: 20299151
and also, please include the whole, script it is still not woirking. I mean, please write the script from start till end including the variables definitions. and should i include any library. in the Reference...
0
 
LVL 1

Author Comment

by:ramimassoud
ID: 20299341
I keep on getting this message when I try to run the script. It says: Error accessing file. Network Connection May have been lost.
0
 
LVL 14

Assisted Solution

by:daveslater
daveslater earned 600 total points
ID: 20338203
Hi
first you need client access on you PC.
then look at this question and post back and queries

http://www.experts-exchange.com/Programming/Programming_Platforms/AS400/Q_20865100.html

Dave
0
 
LVL 1

Author Comment

by:ramimassoud
ID: 20342112
hey man I did.. it worked... not I need some help in some other things... I'll post back a question in a couple of min... What I did is I created a new blank database and it worked... but on the database I am working it did not... so I guess I have to start from scratch on the new database... but no problem as long as it worked... thanks buddy...
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

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

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Suggested Courses

926 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