Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB Databases
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 14th, 2003, 05:03 PM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default IBM AS400 + VB - retrieving AS400 file definitions

Hi,

I can successfully link a table in MS Access using the Client Access ODBC Driver to the AS400. This will bring down the table field/file definitions as they are on that database - with names like #1NTXS etc.

I have put together a routine in VB that automates this process but tables with those field names are not much use to me.

I need a way to retrieve the field descriptions that also exist on the AS400 for these fields. Does anyone have way to do this??

 
Old July 23rd, 2004, 12:55 PM
Authorized User
 
Join Date: Jul 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is a sql command I use to get the structure from my AS400.

SELECT
DBILIB, --DATA LIBRARY NAME
DBIFIL, --DATA FILE NAME
DBIPOS, --FIELD POSITION
DBIFLD, --FIELD NAME
DBITYP, --DATA TYPE
DBITXT --FIELD TEXT (this is what you are looking for)
FROM QSYS.QADBIFLD
WHERE DBLIB='MYDATALIBRARY' AND DBIFIL = 'MYDATAFILE'

David

sample output

V84MODDTA AISAP900 1 PGACTV CHAR Active Flag 0=Inactive, 1-Active
V84MODDTA AISAP900 2 PGCMPN DECIMAL Company Number
V84MODDTA AISAP900 3 PGPLTN DECIMAL Plant Number
V84MODDTA AISAP900 4 PGDRPG CHAR DRP Product Group Code
V84MODDTA AISAP900 5 PGGDES CHAR DRP Product Group Description
V84MODDTA AISAP900 6 PGREQF CHAR U.O.M Qty Requirements Flag
V84MODDTA AISAP900 7 PGLFMU CHAR Last F/M User I.D.
V84MODDTA AISAP900 8 PGLFMP CHAR Last F/M Program Name
V84MODDTA AISAP900 9 PGLFMD DATE Last F/M Date
V84MODDTA AISAP900 10 PGLFMT DECIMAL Last F/M Time HHMMSS





Similar Threads
Thread Thread Starter Forum Replies Last Post
IBM AS400 Message Errors to show them in .NET appl julenis SQL Server 2000 2 July 12th, 2006 01:45 PM
IBM AS400 Message Errors to show them in .NET appl julenis C# 0 July 12th, 2006 10:28 AM
Data Adaptor - IBM AS400 JesseH ADO.NET 1 February 21st, 2006 01:19 AM
Working with IBM AS400 texasraven ADO.NET 9 August 20th, 2004 12:05 PM
Jsp out.flush() not working on IBM Websphere AS400 mmalik_altaf Pro JSP 0 June 28th, 2004 09:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.