"Requested registry access is not allowed" creating OleDb connecti

Discussion in 'ASP .Net' started by =?Utf-8?B?YmZwcm9n?=, Aug 18, 2005.

  1. 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.
     
    =?Utf-8?B?YmZwcm9n?=, Aug 18, 2005
    #1
    1. Advertising

  2. http://support.microsoft.com/?id=329291


    "bfprog" <> wrote in message
    news:...
    > 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.
    >
     
    Grant Merwitz, Aug 18, 2005
    #2
    1. Advertising

  3. Re: "Requested registry access is not allowed" creating OleDb conn

    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" <> wrote in message
    > news:...
    > > 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.
    > >

    >
    >
    >
     
    =?Utf-8?B?YmZwcm9n?=, Aug 18, 2005
    #3
  4. Re: "Requested registry access is not allowed" creating OleDb conn

    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.

    "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" <> wrote in message
    > news:...
    > >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" <> wrote in message
    > >> news:...
    > >> > 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.
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
     
    =?Utf-8?B?YmZwcm9n?=, Aug 19, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gary
    Replies:
    2
    Views:
    1,267
    Jeffrey Tan[MSFT]
    Jan 17, 2004
  2. HK
    Replies:
    1
    Views:
    3,649
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  3. Kovan A.
    Replies:
    0
    Views:
    1,003
    Kovan A.
    May 31, 2004
  4. =?Utf-8?B?Sm9zaCBGbGFuYWdhbg==?=

    Requested registry access is not allowed.

    =?Utf-8?B?Sm9zaCBGbGFuYWdhbg==?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    8,796
    Alex Drougov
    Nov 5, 2004
  5. Ray5531
    Replies:
    2
    Views:
    6,906
    Ray5531
    May 19, 2005
Loading...

Share This Page