<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener("load", function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <iframe src="http://www.blogger.com/navbar.g?targetBlogID=34083602&amp;blogName=LEARN+MS-ACCESS+TIPS+AND+TRICKS&amp;publishMode=PUBLISH_MODE_FTP&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;searchRoot=http%3A%2F%2Fblogsearch.google.com%2F&amp;blogLocale=en_US&amp;homepageUrl=http%3A%2F%2Fwww.msaccesstips.com%2F" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" allowtransparency="true" title="Blogger Navigation and Search"></iframe> <div></div>
www.msaccesstips.com

LEARN MS-ACCESS TIPS AND TRICKS


International Response Fund

LEARN MS-ACCESS TIPS AND TRICKS

↑ Grab this Headline Animator

Your Ad Here
Thursday, June 19, 2008

Linking with IBM AS400 Tables

We can convert IBM iSeries (AS400) DB2 Table into dBase Format, download and Link or Import into MS-Access Databases. The downloading procedure must be created and run from AS400 Menus. If it requires several steps before the output file being transferred to local drive then it can be automated with Macro Scripts. The key strokes can be recorded and modified in such a way that the target file goes to a specific location on the Local Machine with a predefined name that remains linked with the Microsoft Access Database.


If you have sufficient Access Privileges to iSeries (AS400) Main Frame Tables you can Link them directly into your MS-Access Database. We are going to look into this method with ODBC based procedure shortly.


Normally, Reports are generated from AS400 and provided to Users as Hard Copies, or converted into Report Spool File in Text Form, if Soft Copy is requested for. We can download this File either in Text form or upload it into Microsoft Excel (may not Parse the data correctly into Number or Date etc.) with iSeries Report Down-Loader Program. AS400 tables also can be downloaded directly into Microsoft Excel and in this process, if the number of lines are more than 65535 (the limitation of Microsoft Excel Worksheet) it will create more than one Worksheet automatically to accommodate all the data into Excel File.


Later on, we will look into a VBA Program to upload the AS400 Report Spool File directly into Microsoft Access Table, after removing Report Headers and other unwanted lines.


But for now, let us go through the steps for Linking IBM iSeries DB2 Tables into MS-Access Database. The example images are created from Windows2000 Workstation.


Creating ODBC System DSN


  1. Select Start Menu - - > Settings - - > Control Panel -- > Administrative Tools - -> double-Click on Data Sources (ODBC).



  2. The ODBC Data Source Administrator Settings will be displayed. See the Image given below. The Following Steps will walk you through the procedure:


    ODBC Data Source Administrator

  3. Select System DSN Tab on the ODBC Data Source Administrator.

  4. Click Add… Button to display a list of Data Source Drivers.


  5. New Data Source Driver selection Control

  6. Select Client Access ODBC Driver (32-bit) from the displayed list in the Create New Data Source Control and Click Finish.


  7. Define Data Source Name

  8. Type a name in the Data Source name Control. I have inserted the name myData as Data Source Name. We have to look for this name when we attempt to link the Table to MS-Access.


  9. Click on the Server Tab.


  10. Library List and Data Selection Method

  11. Type the specific iSeries Folder Name where your data table resides in the Library List Control. If more than one Library is there then separate them with Comas.

  12. Put a check mark on the ‘Read-Only (Select statements only) option under Connection Type, to ensure that we have no intention to modify the data in iSeries Table.

  13. Click Apply followed by OK Button. The System Data Source Name myData appears in the System DSN Tab. See the image below.


  14. New Data Source Name created

  15. Click OK to close the ODBC Configuration Main Control (the Apply button remains disabled in this case).



Linking to MS-Access Database


  1. Open your MS-Access Database.

  2. Select File - -> Get External Data - - > Link Table or Import Option.


  3. Select ODBC Databases in the Files of Type control in the Common Dialog Control and Click Link (or Import) Button as the case may be.


  4. Select Machine Data Source Tab on the ODBC Control and find the Data Source Name myData that you have created, select it and click OK.

  5. Data Source Name Selection

    You will be prompted for AS400 User-ID and password. Key-in your User ID, Password and Click OK.


    A List will open up showing all the Table Names available in the AS400 iSeries Machine Prefixed with the Library Name following by a period.


    Data Source Name Selection
  6. Select the Table(s) to Link and Click OK.


    The Fields of the selected Table will be displayed suggesting to highlight one or more fields for indexing, if needed.


  7. Highlight the Field(s), if you would like to create a Unique Index for the Table, otherwise Click OK without selecting any.


Data Source Name Selection

The selected Table will be linked (or Imported as the case may be) into your Database.


If the table remains linked, whenever you attempt to use the table after opening your MS-Access Database for the first time it will prompt for the AS400 iSeries UserID and Password and after that the login is valid for the current Session.


If you don’t want this to happen in the middle of some processing steps it is better to invoke the login immediately after opening the Database. To do this, create a Query or Form or Report using the linked iSeries Table that opens with an Autoexec Macro or the Form in Startup, or even better write a VBA routine to open the linked table which will invoke the login and the User is prompted for keying in her User ID and Password at the beginning of the current session itself. This will take care of the rest of the Session.



StumbleUpon Toolbar




Days in Month Function
Finding Consecutive Workdays with Query
Transparent Command Buttons
Colorful Command Buttons
Double Action Command Button

Labels:

2 Comments:

Anonymous Anonymous said…

this type of data transfer is not possible in windows xp. I am getting junk data when data are being transferred from as400 to ms access. But same thing is possible in windows 2000. I do not know , what is the reason? Pls advise me. Amitmohan

February 25, 2010 4:54 PM  
Blogger a.p.r. pillai said…

I could not test the procedure under WindowsXP. Now I am retired from service I don't have access to AS400 System to try it out either. But, I don't see why it cannot work under WindowsXP. Try to insert the ODBC String into the ConnectStr Property of a new Query and open the AS400 Table directly rather than linking it to the database. Sample ODBC String is given below.

ODBC;DSN=myData;UID=UserID;PWD=Password;TABLE=PAVUP.APC161D

You may read the Article: http://www.msaccesstips.com/2008/09/source-connect-str-property-and-odbc.shtml to take the ODBC string from your DSN.

Regards,

February 27, 2010 2:42 PM  

Post a Comment

Note:Comments subject to Review by Blog Author before displaying.

Links to this post:

Create a Link

<< Home


Creative Commons License
Learn MS-Access Tips and Tricks by msaccesstips.com is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 India License.



This Page is best viewed with 1280 x 1024 Resolution

   FEATURED LINKS
SITEMAP
Command Button Animation
3D Headings on Forms
MsgBox & Office Assistant
Reminder Ticker
MS-Access & E-Mails
Automated E-Mail Alerts
MsgBox with Options Menu
Colorful Command Buttons
Configure Lotus Notes
Alerts through Network
Running this site has become a costly affair as the revenue from Ads is not sufficient to support it. If you find these pages informative & useful and would like to extend a helping hand, then please do it here.





Link Back to us with this Button

Learn MS-Access

Copy and Paste this HTML Code in your Webpage


Add to Technorati Favorites

Programming Blogs - Blog Catalog Blog Directory
Powered by FeedBurner
Add to Google

Software
Computers blogs
TopOfBlogs




AddMe - Search Engine Optimization Submit Your Site Free!
Go BlogZ Ave Blogs
eBlogzilla Changing LINKS
LS Blogs Blogarama
blog search directory BlogUniverse
Find Blogs in Directory RSS Directory
blogskinny.com ShowcaseBlogs.com
Amfibi

Search Engine Optimization and SEO Tools
Dmegs Web Directory Takeaway for Sale Businesses For Sale
Free Submission Directory Free site submission

Free Listing
 





Free Page Rank Checker

AddThis Social Bookmark Button

Enter your email address:

Delivered by FeedBurner



Top Blogs


Microsoft Access is the Jewell among MS-Office suite of Applications. Its Security features are excellent and works fine in Network environment. MS-Access can link/upload data from any Data Source. Applications that you design should be user-friendly and visually pleasing too. Here I would like to share my experience in Microsoft Access Programming with you and I am sure that you will find them interesting too.

My Photo
Name: Ramachandran Pillai
Location: Cochin, India

I am not an Access Guru and not through MS-Access yet. More to learn and I don’t think that aspect has any end because others have their own style of using this tool. We can learn lot more tricks, other than what we already know, from others too. My programming skills in COBOL, BASIC, Turbo-C, dBase, FoxPro, Visual Basic & Basic HTML attained through self-learning. I wrote my first COBOL Program in 1975 for ICL1901, 3rd Generation Main Frame Computer. Worked as a Computer Operator (NCR VRX8555 Mainframe Machine upto 1990) with M/s. Y.B.A. Kanoo, Saudi Arabia. Started using MS-Access Ver.2 in 1996, when dBase III+ and Foxbase (later version Foxpro) were my favorite DBMS. During Last 13 Year period I have developed more than 45 In-House Applications (medium & small) under MS-Access for our Organization, a leading Automotive Company in Oman. All the Applications are fully Secured and runs under Windows Network. It is my pleasure to share my experience with others. Anything interesting that you would like to share with me, please do. My E-mail Address: aprpillai@msaccesstips.com


If you need a Demo of any of the Topic explained here, send me an E-mail to: aprpillai@msaccesstips.com
with the Topic Description, I shall try to send a sample database to you.


Access Tips | Email | Reports | Report Tricks | Graphs | Forms | Menus | Animation | Security | Internet | How TOs | Linking | Query | Progress Meter | Alerts | Process Tips | Access Functions |




Site Designed by:www.msaccesstips.com