"Requested registry access is not allowed" creating OleDb connecti

G

Guest

Using IBM iSeries client access OLEDB provider to connect to DB2 on AS/400,
but cannot create connection using .NET web app. Using following code:

Dim cnTest As New OleDbConnection("Provider=IBMDA400; Data Source=S10324NM;
User ID=THEUSER; Password=THESECRET")

Works fine in console app, but fails in web app with:

System.Security.SecurityException: Requested registry access is not allowed.

Any help would be appreciated.
 
G

Guest

I had already tried modifying the registry in accordance with the
instructions in this article, but I still get the error. By the way, I am
currently attempting to run this under IIS5 - WinXP SP2.

Any other ideas?

Thanks.
 
G

Guest

Thanks.

I tried that, and I still get the same error. Following is the complete
stack trace:

SecurityException: Requested registry access is not allowed.]
Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +473
System.Data.Common.ADP.ClassesRootRegistryValue(String subkey, String
queryvalue) +219
System.Data.OleDb.OleDbConnectionString.ValidateParse() +371
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseString(String
connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionString(String value) +11
OrderTying.Testcn.Page_Load(Object sender, EventArgs e) in C:\Documents
and Settings\urac\My Documents\OrderTying\OrderTying\Test\Testcn.aspx.vb:30
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +2112
System.Web.UI.Page.ProcessRequest() +218
System.Web.UI.Page.ProcessRequest(HttpContext context) +18

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87

It appears that this was just a problem with registry authorization. I
granted full control for ASPNET to registry key HKEY_CLASSES_ROOT\IBMDA400,
and that fixed the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top