I am trying to access tables in DB2 from a VB.NET application using OLEDB. The connection is going through a DB2 Connect Server, where I'm using the following connection string:

Provider=IBMDADB2; Database=myDataBase; Hostname=Db2Connect Server; Protocol=TCPIP; Port=50000; Uid=myUsername; Pwd=myPassword;

The Database name "myDataBase" is actually an alias defined on the DB2 Connect server using the DB2 Configuration Assistant. As part of the configuration of this alias, I set the CLI setting "CurrentSQLID" to be "DBATEST", which is different than "myUsername".

I can connect fine to the database, and I can select from the table DBATEST.Table1. However, I cannot select from "Table1" without qualifying the DBATEST. This is the problem! The purpose of the CurrentSQLID setting in the alias is to automatically take care of this qualifying problem. For some reason, my connection through this alias is not applying this setting. If I manually execute the statement "SET CURRENT SQLID" before selecting from "Table1" it also works.

Does anyone know why using an Alias defined on the DB2 Connect server does not take advantage of the CurrentSQLID parameter setting?

Just to make things interesting, if I define an alias on my local PC using the local client, and set this value, and therefore create an ODBC connection on my local machine, it works fine (although I want to do this without ODBC)!