locked
Custom Web App integrated into WSS cannot connect to MS-Access RRS feed

  • Question

  • User1618171823 posted

    Hi Everyone

    Ive integrated a custom asp.net web application into a WSS site
    by creating a virual directory, that contains my web app files, that points to a directory in the WSS inetpub folder.

    On my local dev server I can access all my web app pages just fine by typing in /virtualdirectoryname/page.aspx

    My Problem is that: When I deploy to my Live Test server that is internet facing, none of the pages that make a MS-Access database call will work.

    The Error I receive is
    '[SecurityException: Request for the permission of type 'System.Data.Odbc.OdbcPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]'

    I have researched the issue online and tried numerous solutions which include giving all the assemblies in my application a strong name, and modifying the security policy to trust this strong name.
    However no luck


    Details of my Web App are as follows

    1.   Web App consists of 2 projects : A c# Class Library Project (Data Layer)
    2.   Web App consists of 2 projects : An asp.net Web Application Project (Web Layer)

    3.   My .mdb database file is stored at root level within the Virtual Directory.

    4.   I have 1 class in the Data Layer (ClassConnect.cs) that when instantiated, creates the ODBC connection for all other pages to use(OdbcConnection dbConn = new OdbcConnection();)

    5.   I have a Connection String stored in the web.config file that is as such.
    <connectionStrings>
     <add name="accessDb" connectionString="Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\websites\default\wss\VirtualDirectories\80\Access\App_Data\BBC.mdb; Uid=Admin;Pwd=;"/>
    </connectionStrings>
    When I deploy to the Live Test Server I change the path in this connection string, because I haven't figured out yet how to get a relative path that works.

    6.   I also place the dll's for my 2 projects in the Sharepoint bin folder.

     

    Could anyone suggest what might be the dfference between my Local Dev Server and the Live Test Server and why I might be getting these errors.

    Much Appreciated.


     

    Monday, January 10, 2011 9:45 AM

Answers

  • User1618171823 posted

    Okay I solved the problem.


    I had to place the 2 dll's for the custom web app in the GAC and run a IISRESET.

    This seemed to solve the problem.



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 12, 2011 7:27 AM