From .Net, I can connect to the DB2 database:
- First I include a link to "IBM.Data.DB2.iSeries"
Then I create a new IBM.Data.DB2.iSeries.iDB2Connection. Connection string
DataSource=ChaDb2Server;UserID=MyUsername;Password=MyPassword;
Then I create the IBM.Data.DB2.iSeries.iDB2Command file, etc.
Now I am trying to get my SQL Server 2005 to access the same data directly. In SQL Server Management Studio, right-click on Linked Servers and select "New Linked Server ..."
Linked Server: ChaDb2Server Provider: IBM OLE DB Provider for DB2 Product Name: ??? Data Source: ChaDb2Server Provider String: DataSource=ChaDb2Server;UserID=MyUsername;Password=MyPassword; Location: ???
I can leave the field empty, but the product name cannot be empty, and I do not know what to fill here.
On the Security tab, I select "Running Using This Security Context" and I repeat the UserID and password.
A linked server is created, but when I try to expand Catalogs / default / Tables, I get an error:
OLE DB provider 'IBMDADB2.DB2COPY1' reported an error. Authentication failed. (Microsoft SQL Server, Error: 7399)
I do not know where the name IBMDADB2.DB2COPY1 came from.
Also, when I try to select data:
Select * from ChaDB2Server.ChaDb2Server.Information_Schema.Tables
I get a similar error:
Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'IBMDADB2.DB2COPY1' reported an error. Authentication failed.
Obviously, something is missing in the way I connect the servers. Does anyone know how to do this?