Last post May 31, 2009 06:06 AM by PNasser
May 29, 2009 04:01 PM|TGSMendota|LINK
Is there any way from within an ASP.Net page to connect to an Access Database that is stored on the client PC's local hard drive or local area network drive?
I can connect to an Access Database from within an ASP.Net page when the database is stored on the same web server as the ASP.Net page. But, when the database is stored on the client PC's local hard drive, I don't know what to specify for the database location
(Data Source) in the ConnectionString property of the OleDbConnection object. As an example, if the database is stored as "C:\foldername\database.mdb" on the client PC, "C:\foldername\database.mdb" is not interpreted the same by the ASP.Net page on the web
I realize that this is probably not the standard way to have things organized with the database on the client PC's hard drive. The current goal of the associated web site is to provide a database management service using a database that the web site user/customer
is responsible for storing and protecting. In theory, each user/customer will have a separate/dedicated database that no other customer will be able to access.
Ms access database
May 29, 2009 05:05 PM|PNasser|LINK
There isn't any way to do this in an asp.net page, without using some custom plugin.
This is a security risk if your page had access to their files.
May 29, 2009 05:45 PM|TGSMendota|LINK
I take it by your response that there is no way to get/specify a location for a client database in a ConnectionString stored in the .aspx.vb file. Is that correct?
Is there a way for a client to give only a specific web site access to a specific local file, but deny access to all other local files?
Thanks for your interest in my question.
May 30, 2009 04:57 AM|PNasser|LINK
There are 2 ways I can think of.
If the user installs the database along with the server piece to / routing to access it via the web, then they could give you the url to that server (you might even be able to generate the url yourself if you setup your database install software correctly).
Then it would be their ip address + some port. This assume that they aren't behind firewalls / routers etc that might screw up this routing. You could then use this URL for your connection string and connect like any other database.
A Plugin / Browser Helper Object:
I don't work with these particular techonologies, but I found this Wikipedia entry that might get you off in the right direction (this is for IE, you'd need to create a separate plugin for firefox or any other browsers you want to support):
They are basically little programs that users install on their system, which could then be created to interact with your page, which could be written to give your webapp access to the database. The problem is that the database would only be accesible to
your web app if it was on the computer that was visiting it. So if you have a client X on pc XPC (with the db), he would have to visit your app on XPC, if he was on his buddies computer YPC, he could not access the database.
May 30, 2009 07:28 AM|hans_v|LINK
I really can't imagine why you want to create a web application that uses a local database? Create a windows application instead!
May 30, 2009 01:34 PM|Mikesdotnetting|LINK
I agree with Hans. I cannot see the point of developing a central web application if the different client databases are stored on their local machines/networks. That's a job for a Windows app.
May 31, 2009 06:06 AM|PNasser|LINK
I completely agree with both of the above posters, I was just trying to work within the framework of the question :)