Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Having problem with Provider trying to connect to DB2

Status
Not open for further replies.

LarrySteele

Programmer
May 18, 2004
318
US
I'm using the following syntax for my connection: [tt]"Provider=IBMDADB2;Database={db};Hostname={host};Protocol=TCPIP;Port=50000;Uid={id};Pwd={pw};"[/tt]

When I run the site from VS2010, I get data back. When I try to run the site from a browser (even on the server) I get this error:
[tt]The 'IBMDADB2' provider is not registered on the local machine.[/tt]

It is in fact registered. I know because VS was able to populate the page. I also know because I went ahead and did the unregister/re-register because seemed like it worked for some based on their forum posts.

I saw a few threads that said they solved this by adding ASPNET to the DB2USERS and DB2ADMINS groups. I would have tried this, but no ASPNET user on the server.

After several hours yesterday and even more today search through the Great Google Machine, and working with the IT group here, I've hit the point where I need help. Otherwise, I'm going to just start repeating the same steps, and I really don't have the bandwidth to play that game.

here's the complete class:
Code:
    public class Db2Conn
    {
        internal static OleDbConnection GetDb2Connection()
        {
            return new OleDbConnection("Provider=IBMDADB2;Database=X;Uid=X;Pwd=X;Hostname=X;Protocol=TCPIP;Port=50000;");
        }
    }

Again, this works perfectly from VS (whether in debug mode or starting w/o debug). It's only when opening this page from a browser window. Other pages render just fine, only this one that attempts to use the IBMDADB2 provider.
 
If you are using II7, add the "NETWORKSERVICE" account.
See if that works for you.
 
Thanks for the suggestion. I added "NETWORK SERVICE" to DB2ADMINS and DB2USERS - no change, so reverted. I then gave "NETWORK SERVICE" explicit access to SQLLIB - parent directory for the DLL. Still no change, so reverted.

Oh, and I did stop and restart ISS after each change.

Which reminds me, I forgot to mention...

Windows Server 2008 R2
IIS 7.5.7600.16385
.Net Framework v4.0.30319


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top