Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

Linking with IBM AS400 Tables

Introduction.

IBM iSeries (AS400) DB2 tables can be converted into dBase format, downloaded, and then linked or imported into MS Access databases. The downloading process is typically initiated and run from the AS400 menus. If multiple steps are required before transferring the output file to the local drive, this process can be automated using macro scripts. Keystrokes can be recorded and modified so that the target file is saved to a specific location on the local machine with a predefined name, allowing it to remain linked to the Microsoft Access database.

You need the necessary Access privileges to the iSeries (AS400) mainframe tables, and you can link the table directly into your MS-Access database using an ODBC-based procedure.  We will explore this aspect shortly.

Typically, Reports are generated on the AS400 and delivered to users as hard copies or exported as text-based spool files if a soft copy is required. These files can be downloaded in text file format or imported into Microsoft Excel—though Excel may not always parse numbers, dates, or other formats correctly. AS400 tables can also be downloaded directly into Excel. If the number of rows exceeds 65,535 (the limit for an Excel worksheet), multiple worksheets will be created automatically to accommodate all the data.

Linking to IBM iSeries DB2 Tables.

Let us review the steps for linking IBM iSeries DB2 Tables in MS-Access Database. The example images are created from the Windows 2000 Workstation.

Creating ODBC System DSN.

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

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

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

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

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

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

  6. Click on the Server Tab.

  7. Type the specific iSeries Folder Name where your data table resides in the Library List Control. If more than one Library File, separate them with Commas.

  8. Select the Read-Only (Select statements only) option under Connection Type to ensure that we have no intention to modify the data in the iSeries Table.
  9. Click the Apply button followed by the OK Button. The System Data Source Name myData appears in the System DSN Tab. See the image below.

  10. 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 the Link (or Import) Button, as the case may be.

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

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

    The Tables list will open up, showing all the Table Names available in the AS400 iSeries Machine, prefixed with the Library Name followed by a period.

  5. Select the Table(s) to Link and Click OK.

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

  6. Highlight the field(s) if you would like to create a Unique Index for the Table; otherwise, click OK without selecting any.

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

The AS400 Login Issue

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

If you don't want this to happen in the middle of some process, it is better to invoke the login immediately after opening the Database. To do this, create a Query, Form, or Report that uses the linked iSeries Table, and opens it with an Autoexec Macro or the Form in Startup. Even better, create a VBA routine to open the linked table that invokes the login procedure, and the User Logon at the beginning of the current session. This will take care of the rest of the Session time.

Share:

4 comments:

  1. 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

    ReplyDelete
  2. 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/ to take the ODBC string from your DSN.

    Regards,

    ReplyDelete
  3. driver Search...

    [...]worth a try - even though we provide external links we aren't responsible for th[...]...

    ReplyDelete

Comments subject to moderation before publishing.

PRESENTATION: ACCESS USER GROUPS (EUROPE)

Translate

PageRank

Post Feed


Search

Popular Posts

Blog Archive

Powered by Blogger.

Labels

Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Objects Menus and Toolbars Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Combo Boxes Dictionary Object ListView Control Query VBA msaccessQuery Calculation Event Graph Charts ImageList Control List Boxes TreeView Control Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Key Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances ImageList Item Macros Menus Nodes RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference Utility WScript Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Desktop Shortcuts Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Message Box Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code