Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:28:10+00:00 2026-05-26T22:28:10+00:00

This is kind of a ‘double’ question that might have a single answer. I’m

  • 0

This is kind of a ‘double’ question that might have a single answer.

I’m working with an Odbc Connection with an AS/400, with my connection string as follows:

driver={iSeries Access ODBC Driver}; system={0}; uid={1}; pwd={2}; DefaultLibraries=*USRLIBL;    

I’m able to connect to the system fine.

*USRLIBL contains all the necessary libraries from the user (which is of the type ‘API only’ which has access to all user libraries).

However, when I try to access certain ERP libraries, it says they can’t be found, while other ones can.

So as an extremely basic walkthrough:

1. Open Connection - Query File 1 from Library A:  OK! - Close Connection
2. Open Connection - Query File 2 from Library A:  OK! - Close Connection
3. Open Connection - Query File 1 from Library B:  Exception  SQL0204 - in UserName type *FILE not found 

Ok, so I added in the specific library that the ERP files would be in, making the connection string as follows, just to test the program:

driver={iSeries Access ODBC Driver}; system={0}; uid={1}; pwd={2}; DefaultLibraries=*USRLIBL, LibraryB; 

But then I start getting a different problem (another extremely basic walkthrough)

1. Open Connection - Query File 1 from Library A:  OK! - Close Connection
2. Open Connection - Query File 2 from Library A:  OK! - Close Connection
3. Open Connection - Query File 1 from Library B:  OK! - Close Connection
4. Open Connection - Query File 1 from Library A again:  Exception SQL0202 - in LibraryB type *FILE not found.  

So my question(s) are:

Why doesn’t the odbc connectionstring DefaultLibraries=*USRLIBL not return the correct libraries? (Note: I also tested this using an iDB2Connection which in fact works fine… however, the iDB2Connection can not be deployed as it literally crashes the server)

Why does the second walkthrough throw an exception, it just seems to ‘skip past’ *USRLIBL after reading from LibraryB even once.

Any thoughts?

Begin Edit:

There are actually two users, DEV and PROD

The *USRLIBL gets all the necessary Libraries from the Environment itself, so if when opening the connection, it detects a localhost environment, or anything that’s unsecure (plus a few other caveats), it defaults to DEV log in credentials before creating the connection. This is why the system, uid, and pwd are designated as parameters in the connection (and not just stackoverflow I-dont-want-to-give-out-data placeholders)

The *USRLIBL then pulls the necessary libraries from the API user.

To Clarify, the way it’s set up does work using the iDB2 Connector, but because of the limitations of our ERP system (we think), using it with an IIS 7 server causes a catastrophic failure, so we’re working with the ODBC connector.

End Edit:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:28:11+00:00Added an answer on May 26, 2026 at 10:28 pm

    You can qualify your table names as library.filename and not have to deal with any library list issues.

    For more information:

    Client Access ODBC: Default Libraries Setting

    ODBC connection string keywords


    Excerpts of the relevant parts are:

    With SQL naming convention, the operating system does not perform a library list search to locate an unqualified object. If a default collection is defined, the default collection is used to resolve unqualified SQL statements.

    …

    With the SYS naming convention, the unqualified SQL statements go to the default collection. If there is no default collection, the current library is used. If no current library is specified, the library list is used.

    …

    Default Collection

    A job attribute set by ODBC that determines the library used when processing SQL statements that contain unqualified SQL names. When a default collection is set all unqualified objects except procedures, functions and types must reside in the default collection, regardless of naming convention.

    …

    How can I get ODBC to search the library list?

    As explained above, edit the ODBC data source and set system naming to SYS. The default library must be empty, or on versions older than R510, the default libraries setting must start with a comma so that no default collection is defined (for example, “,MYLIB1, MYLIB2”).


    Try this connection string to enable system naming and to not set a default library:

    driver={iSeries Access ODBC Driver}; system={0}; uid={1}; pwd={2}; naming=1; DefaultLibraries=,*USRLIBL,LibraryB;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this kind of follows on from another question of mine. Basically, once I have
I have ask this kind of question before, but it seems my previous question
I am sure that this kind of questions must have been asked before, but
I know this kind of question is asked a lot but I have a
I have this kind of structure that I want to both read and write
I know questions of this kind have been asked before, but my situation differs
I have this kind of code in some applications (from microsoft) [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage( Microsoft.Naming,
I know this kind of questions have been asked already many times before. The
I have this kind of node in my xml document: <parent ...> <a .../>
I asked this kind of question before, but didn't receive any good answers, perhaps

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.