Velocity Reviews > using Access database on network share?

# using Access database on network share?

Scott Nicholson
Guest
Posts: n/a

 11-05-2004
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
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.

Scott M.
Guest
Posts: n/a

 11-05-2004
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" <(E-Mail Removed)> wrote in message
news:cmg9d2$e17$(E-Mail Removed)...
> 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
> 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.

Scott Nicholson
Guest
Posts: n/a

 11-05-2004
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?

Scott M.
Guest
Posts: n/a

 11-05-2004
I'm saying that Access OLEDB connection strings must point to a local
physical path. Server paths won't work.

"Scott Nicholson" <(E-Mail Removed)> wrote in message
news:cmgesh$ik2$(E-Mail Removed)...
> 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?

Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a

 11-06-2004
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:

http://msdn.microsoft.com/library/de...ersonation.asp

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

"Scott Nicholson" <(E-Mail Removed)> wrote in message
news:cmg9d2$e17$(E-Mail Removed)...
> 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
> 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.