locked
Web Application Path to Local Database RRS feed

  • Question

  • User937631264 posted

    Is it possible for an ASP.NET web application installed on a web server to connect to an Access database stored on a local PC (which is NOT the web server)?

    I would like the web application to allow the user to specify the path/complete file specification to the database.  Or, based on login information specified by the user, the web application might determine the path to the database via an administrative database stored on the web server.  The user/customer would be responsible for the storage of the Access database.

    If the answer to my first question is "YES", how do I programmatically specify/format the path to the Access database on the local PC so the web application can locate the database?

    The path has to be something more than "C:\foldername\subfoldername\database.mdb".  When I use a path like this, the web application produces an error indicating that the database does not exist or cannot be found.  So, I'm fairly sure that the web application is not starting with Drive C: on the local PC to find the database.  For all I know, the web application may be interpreting Drive C: as Drive C: on the web server.  I'm wondering if I need to specify a computer name before "C:\" in the database path.

    Monday, September 13, 2010 4:19 PM

Answers

  • User-821857111 posted

    Is it possible for an ASP.NET web application installed on a web server to connect to an Access database stored on a local PC (which is NOT the web server)?

    No.

    Actually, you may be able to do it using client side javascript, or your own ActiveX control, but you would have to lower the browser's security to such a low level that it would only be advisable in a strictly controlled intranet environment, and if you are using IE. It won't work in Firefox. You would have to know the local path of the database too.If it gets moved by the user, the "application" will stop working.

    Frankly, if the database is on the user's computer, then developing a browser-based application is the wrong approach. You need an application that runs on the client machine, not in a browser.

    It's possible some "helpful" soul will come along and post some code that might get you started in the direction you seem to be heading, but it would be wrong on so many levels that I would strongly advise you to rethink your approach.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 13, 2010 6:00 PM