Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > "Requested registry access is not allowed" creating OleDb connecti

Reply
Thread Tools

"Requested registry access is not allowed" creating OleDb connecti

 
 
=?Utf-8?B?YmZwcm9n?=
Guest
Posts: n/a
 
      08-18-2005
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.

 
Reply With Quote
 
 
 
 
Grant Merwitz
Guest
Posts: n/a
 
      08-18-2005
http://support.microsoft.com/?id=329291


"bfprog" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?YmZwcm9n?=
Guest
Posts: n/a
 
      08-18-2005
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.

"Grant Merwitz" wrote:

> http://support.microsoft.com/?id=329291
>
>
> "bfprog" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?YmZwcm9n?=
Guest
Posts: n/a
 
      08-19-2005
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(St ring subkey, String
queryvalue) +219
System.Data.OleDb.OleDbConnectionString.ValidatePa rse() +371
System.Data.Common.DBConnectionString..ctor(String connectionString,
UdlSupport checkForUdl) +144
System.Data.OleDb.OleDbConnectionString.ParseStrin g(String
connectionString) +98
System.Data.OleDb.OleDbConnection.set_ConnectionSt ring(String value) +11
OrderTying.Testcn.Page_Load(Object sender, EventArgs e) in C:\Documents
and Settings\urac\My Documents\OrderTying\OrderTying\Test\Testcn.aspx.v b: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.Htt pApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionS tep 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.

"Grant Merwitz" wrote:

> Try follow the second approach there.
>
> Instead of modifying the registry, they also offered a different solution
> whereby you create a project inheriting from the Installer class.
> Once that is run, with a given EventLog source, you can then log events to
> the EventLog under this source.
> I tried it with IIS6 and it worked fine.
>
> I've attached my project that i made, hope that can help.
> But read the article more on how to implement it (running it from command
> prompt or something)
>
> But i basicly ran this code, and was then able to log to the eventlog
> through my ASP.NET application but only under the source i specified.
> Also notice, if you run this installed class twice in a row, it will error,
> as this source will have already been created
>
> Good luck
>
> >> http://support.microsoft.com/?id=329291

>
>
> "bfprog" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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.
> >
> > "Grant Merwitz" wrote:
> >
> >> http://support.microsoft.com/?id=329291
> >>
> >>
> >> "bfprog" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > 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.
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Access OLEDB connection problem =?Utf-8?B?Uk1M?= ASP .Net 6 07-24-2004 04:18 PM
Reading registry key throws "Requested registry access is not allowed." HK ASP .Net 1 04-01-2004 04:44 PM
asp.net ms-access oledb connection open error Mathew Vording ASP .Net 2 08-15-2003 05:37 PM
Error when trying to add an Access DB Record containing a Long Integer type field using OLEDB in ADO.Net Robert Hanson ASP .Net 4 07-22-2003 01:40 PM
Re: Error when trying to add an Access DB Record containing a Long Integer type field using OLEDB in ADO.Net Robert Hanson ASP .Net 1 07-22-2003 12:54 PM



Advertisments