0
votes

To start off, I'm new to Visual Studio and DB2, so please bear with me. I've been reading different books and will be starting classes soon, but I'm completely stumped with this.

I have a webform set up using VB.

In the web.config file, I've added <add name="rfqAS400TEST" connectionString="Server=serverIP; Database=RFQTST; UID=userid; PWD=password; CurrentSchema=RFQTST;" providerName="IBM.Data.DB2"/> inside of the <connectionStrings> tag. However, when I look at the connection in the Server Explorer, the tables dropdown shows HUNDREDS of tables, none of which are the table I referenced in my connection string.

I've tried to modify the connection and filter by the schema and DbName with no luck - it still only shows the hundreds of other tables instead of the one I want.

When I manually specify a custom SQL statement (SELECT * FROM <library>.<filename/table>) in the GridView Configure Data Source wizard, the GridView displays the records as it should, so I know the connection to the correct library and file is working.

It just seems strange that I have to manually type the statements because the correct table fails to show up in any of the wizards or the Server Explorer. Any suggestions or thoughts would be GREATLY appreciated.

Update

Out of curiosity, I tried to set up the connection using the ODBC datasource and the system data source name as IBM i Access for Windows ODBC. This displays extra tables as well, but it includes the tables that I've been wanting all of this time. This just confuses me more. Does that mean the DB2 connection (even though it technically is connected) is set up incorrectly?

1
If looking for specific libraries, try adding ;LibraryList=lib1,lib2;SchemaSearchList=lib1,lib2; - lamLam
Thank you for the suggestion! I tried adding both together and then both separately to the connection string. Unfortunately, if either one existed in the string, it would break the connection. - HHartman

1 Answers

0
votes

The CurrentSchema is just a proxy for the SET CURRENT SCHEMA, to name the implicit schema qualification, for unqualified table-references. The tables that appear in an ODBC API request such as via SQLTables(), are unrelated to that current_schema.

A generic [db2] provider does not acknowledge\reflect the distinct attributes of the DB2 for i, whereby the database is [in a simplified sense] the entire system; the catalog API calls reflect either that, or that the schemas that are part of the library list concept. With the IBM® i Access ODBC driver, there are Connection string keywords for Connection Properties and Server Properties.
The following Redbooks publication and SQLTables Description may have some value.