Access member table within a library using ODBC

5 pts.
Tags:
AS/400
ODBC
I want to access a member table within a library using ODBC. How can I do that?


Software/Hardware used:
Access
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Use the CREATE ALIAS and specify the file member

CREATE ALIAS QTEMP/MYFILE FOR MYLIB/MYFILE (MYMBR);

AS a warning, do not use the name alias. You can create one but you will not be able to drop it when done using it.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TheRealRaven
    ODBC has no concept of members, so a member cannot be chosen. Instead, you must either provide a database override to redirect to your chosen member before issuing an access to the table or run a SQL CREATE ALIAS statement to create an "alias" name that does the redirection. Once an alias exists, you can acces the table by the alias name, and the actual access will be to the member.

    By using an override, you limit the scope to the job or session that issued the override. By using an ALIAS, you create a database object that can be used by any authorized user or job.

    An override has minimal impact on the system. An ALIAS is somewhat similar to creating any 'permanent' object. The system creates the object, assigns authorities and registers it to the database. The opposite actions take place when the ALIAS is deleted. (I.e., much more processing is involved.)

    The methods for doing either will depend on general details of how you need the result to work and on the code in your ODBC process.
    36,370 pointsBadges:
    report
  • ToddN2000
    I agree with Raven. I use the CREATE ALIAS method myself. It depends on how long you plan on using this as to if you want to do the DROP ALIAS.
    135,305 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: