IIS, WS2003, ADO.net and network drives

J

jem777

Weird!
I am opening an MS Access database using an OleDbConnection.

The system:
1) Windows Server 2003 (with latest patches)
2) .NET framework 1.1
3) R: is a mapped network drive.

From a web page I try to open the connection to the Access db using this
connection string:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=R:\VTVideo.mdb

This outputs me this error:

System.Data.OleDb.OleDbException: 'R:\VTVideo.mdb' is not a valid path.
Make sure that the path name is spelled correctly and that you are connected
to the server on which the file resides.

NB:
1) If the file is local everything works perfectly.
2) The network drive is connected and has all permissions.
3) I tried switching to ODBC connection and the error is the same (this
suggests me that it is an authentication IIS problem).
4) In a Windows2000 environment everything just works!

Pleas help me!

Camillo
 
N

Norman Yuan

What type of app is it? web app (ASP.NET) or windows app? Since you
mentioned IIS, I assume it is web app.

Are you sure the mapped drive "R:\" is there no matter who is currently
looged in? A mapped drive may only available to current log-in user
(especially if it is mapped by lohon script). While the web app is run under
ASPNET/Network Service account, it is very likely the mapped drive can not
bee seen by asp.net running account. Also, there is very possible the web
app may run on a (server) computer where no used is logged in at all, thus,
a drive mapped by logon script will not be there at all. So, you'd better
use UNC path (\\computername\datafiles\data.mdb). Of course, you have to
make sure the web app running account has read/write permission to that
folder, in order *.mdb can be accessed.
 
J

jem777

Norman Yuan said:
What type of app is it? web app (ASP.NET) or windows app? Since you
mentioned IIS, I assume it is web app.

Yes sorry, it is a web application (but the code to conect to db is the same
as a win32 app, thanks to .NET fwk !!!).
Are you sure the mapped drive "R:\" is there no matter who is currently
looged in? A mapped drive may only available to current log-in user
(especially if it is mapped by lohon script). While the web app is run under
ASPNET/Network Service account, it is very likely the mapped drive can not
bee seen by asp.net running account. Also, there is very possible the web
app may run on a (server) computer where no used is logged in at all, thus,
a drive mapped by logon script will not be there at all. So, you'd better
use UNC path (\\computername\datafiles\data.mdb). Of course, you have to
make sure the web app running account has read/write permission to that
folder, in order *.mdb can be accessed.

I log on as Administrator of my machine which has a different password from
the Administrator of the remote machine.
I don't have a domain controller, the machines are not in a domain.
I map the network drive R as Administrator.
I click on the network drive and I reach my MDB file.
If I view the security properties of my network drive "R" I see :

Everybody -> full control.

The strange thing is that on a Windows2000 Server everything worked right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top