本文介绍了SQL1159 DB2 .NET数据提供程序初始化错误,原因码10,令牌0.0.0,9.7.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在控制台应用程序中打开与DB2的连接。它工作正常。当我在IIS中托管的服务中使用相同代码时,
会为DB2引发错误。以下是错误的详细信息。我是否缺少IIS中的某些权限?

I am trying to open a connection to DB2 in console application. It works fine.when I use the same code in a service, hosted in IIS it throws an error for DB2. Following is the error details. Am I missing some permissions in IIS ?

dll:IBM.data.DB2.dll

dll :IBM.data.DB2.dll

代码:

DB2Connection db2Connection = new DB2Connection(connectionString);
DB2Command cmdSelectUsrNameAndPassword = new DB2Command(querySelectUsernameAndPassword, db2Connection);
cmdSelectUsrNameAndPassword.Connection.Open();

抛出:

如果我在控制台中尝试使用ODBC的DSN可以,但是同样会在IIS中引发另一个错误。

If I try a DSN with ODBC in console it works, but same throws another error in IIS.

OdbcConnection DbConnection = new OdbcConnection(DSNName);
DbConnection.Open();

抛出:


推荐答案

猜测它与应用程序池标识有关。我将应用程序池标识设置为网络服务,并在C:\Program Files\IBM\SQLLIB\BIN\netf20_32\中对 IBM.Data.DB.dll上的 Network Service给予了完全许可。 ne工作简洁。

guess it has something to do with App pool identity. I set the app pool identity as "Network service" and gave full permission to "Network Service" on "IBM.Data.DB.dll" in C:\Program Files\IBM\SQLLIB\BIN\netf20_32\ Worked neat.

这篇关于SQL1159 DB2 .NET数据提供程序初始化错误,原因码10,令牌0.0.0,9.7.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:13