Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   using Access database on network share? (http://www.velocityreviews.com/forums/t90214-using-access-database-on-network-share.html)

Scott Nicholson 11-05-2004 04:23 PM

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.

Scott M. 11-05-2004 05:01 PM

Re: using Access database on network share?
 
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" <usenet@scottnic.com> wrote in message
news:cmg9d2$e17$1@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.




Scott Nicholson 11-05-2004 05:56 PM

Re: using Access database on network share?
 
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. 11-05-2004 06:49 PM

Re: using Access database on network share?
 
I'm saying that Access OLEDB connection strings must point to a local
physical path. Server paths won't work.


"Scott Nicholson" <usenet@scottnic.com> wrote in message
news:cmgesh$ik2$1@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?




Steve C. Orr [MVP, MCSD] 11-06-2004 12:55 AM

Re: using Access database on network share?
 
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" <usenet@scottnic.com> wrote in message
news:cmg9d2$e17$1@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.





All times are GMT. The time now is 01:58 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.