469,955 Members | 2,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

using Access database on network share?

I've got a site set up that uses a network share as it's home directory.
Simple stuff is working fine.

When I try to put a database in there, though, I run into problems.

I'm using:

dim dbconn,sql,dbcomm
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data
source=" & server.mappath("test.mdb") & ";")
dbconn.Open()

And I'm getting a message:

Server Error in '/' Application.
Unspecified error
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

Line 16: dim dbconn,sql,dbcomm
Line 17: dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("test.mdb") & ";")
Line 18: dbconn.Open()

"test.mdb" is in the same folder as the .aspx file (maps to
\\omega\www\dir\test.mdb)

.... If I copy all the files to a local folder on the hard drive and
change the home directory of the site it works fine.

Is is not possible to use an access database on a network share? I can't
imagine that's the case.

Help is appreciated.
Nov 18 '05 #1
4 5727
Is it not possible to use an access database on a network share?
Right. Access is not meant for multi-user activity anyway. If you must use
Access, locate it on the same machine as the web application.
"Scott Nicholson" <us****@scottnic.com> wrote in message
news:cm**********@news.xmission.com...
I've got a site set up that uses a network share as it's home directory.
Simple stuff is working fine.

When I try to put a database in there, though, I run into problems.

I'm using:

dim dbconn,sql,dbcomm
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data
source=" & server.mappath("test.mdb") & ";")
dbconn.Open()

And I'm getting a message:

Server Error in '/' Application.
Unspecified error
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

Line 16: dim dbconn,sql,dbcomm
Line 17: dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("test.mdb") & ";")
Line 18: dbconn.Open()

"test.mdb" is in the same folder as the .aspx file (maps to
\\omega\www\dir\test.mdb)

... If I copy all the files to a local folder on the hard drive and change
the home directory of the site it works fine.

Is is not possible to use an access database on a network share? I can't
imagine that's the case.

Help is appreciated.

Nov 18 '05 #2
Scott M. wrote:
Is it not possible to use an access database on a network share?
Right. Access is not meant for multi-user activity anyway. If you must use
Access, locate it on the same machine as the web application.


I'd like to be able to edit this web application on both my desktop and
my laptop, so I've set a share on my fileserver as the home directory
for the site on both machines, and made the share available offline on
my laptop. This way I can edit the files on either machine, whether
connected to the network or not, and can preview the files on either
machine at http://localhost/

So the share is \\omega\www, and I've set that share as the home
directory of my website in IIS.

I've created \\omega\www\dir and put "test.mdb" in that dir, and created
db_test.aspx in the same dir that attempts to access the test.mdb file.

You're telling me this won't work?
Nov 18 '05 #3
I'm saying that Access OLEDB connection strings must point to a local
physical path. Server paths won't work.
"Scott Nicholson" <us****@scottnic.com> wrote in message
news:cm**********@news.xmission.com...
Scott M. wrote:
Is it not possible to use an access database on a network share?
Right. Access is not meant for multi-user activity anyway. If you must
use Access, locate it on the same machine as the web application.


I'd like to be able to edit this web application on both my desktop and my
laptop, so I've set a share on my fileserver as the home directory for the
site on both machines, and made the share available offline on my laptop.
This way I can edit the files on either machine, whether connected to the
network or not, and can preview the files on either machine at
http://localhost/

So the share is \\omega\www, and I've set that share as the home directory
of my website in IIS.

I've created \\omega\www\dir and put "test.mdb" in that dir, and created
db_test.aspx in the same dir that attempts to access the test.mdb file.

You're telling me this won't work?

Nov 18 '05 #4
The default ASPNET user account doesn't have network permissions.
One solution is to change ASP.NET to run under a different account that has
the necessary permissions. For testing purposes I suggest having it run
under your user account since you know you have permission.

For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyAppUser">
password="password"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Scott Nicholson" <us****@scottnic.com> wrote in message
news:cm**********@news.xmission.com...
I've got a site set up that uses a network share as it's home directory.
Simple stuff is working fine.

When I try to put a database in there, though, I run into problems.

I'm using:

dim dbconn,sql,dbcomm
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data
source=" & server.mappath("test.mdb") & ";")
dbconn.Open()

And I'm getting a message:

Server Error in '/' Application.
Unspecified error
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Unspecified error

Source Error:

Line 16: dim dbconn,sql,dbcomm
Line 17: dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("test.mdb") & ";")
Line 18: dbconn.Open()

"test.mdb" is in the same folder as the .aspx file (maps to
\\omega\www\dir\test.mdb)

... If I copy all the files to a local folder on the hard drive and change
the home directory of the site it works fine.

Is is not possible to use an access database on a network share? I can't
imagine that's the case.

Help is appreciated.

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Random Person | last post: by
1 post views Thread by Daveyk0 | last post: by
13 posts views Thread by Elton Cohen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.