Error accessing MS Access database with Linked Tables on fileshare

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a ASP.Net application that uses a MS Access database. The site works
fine when all databases resides locally but on my public server I need to use
a different database where the main databasefile resides locally but also has
tables linked that resides on a fileshare/network drive.

When I try to run my app I know get an:
'database.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.
The database.mdb file is one that resides on the fileshare.

I suspect that this has something to do with permissions on the remote
machine but I don not understand what I need to do. I have tried to use
impersonation by adding the <identity impersonate="true" /> tag to the
web.config file but that only seems to work on my win XP machine running IIS
5.1. When I try to do the same on the server (Win2K running IIS 5.0) I get an
"Unspecified error" when calling Connection.Open().

Does someone know a solution? Am I even posting this on the right forum?

Best regards
PÃ¥l Eilertsen
 
¤ Hi,
¤
¤ I have a ASP.Net application that uses a MS Access database. The site works
¤ fine when all databases resides locally but on my public server I need to use
¤ a different database where the main databasefile resides locally but also has
¤ tables linked that resides on a fileshare/network drive.
¤
¤ When I try to run my app I know get an:
¤ 'database.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.
¤ The database.mdb file is one that resides on the fileshare.
¤
¤ I suspect that this has something to do with permissions on the remote
¤ machine but I don not understand what I need to do. I have tried to use
¤ impersonation by adding the <identity impersonate="true" /> tag to the
¤ web.config file but that only seems to work on my win XP machine running IIS
¤ 5.1. When I try to do the same on the server (Win2K running IIS 5.0) I get an
¤ "Unspecified error" when calling Connection.Open().
¤
¤ Does someone know a solution? Am I even posting this on the right forum?

Well yes this is probably the appropriate group although I did reply in the vb.database group. We
can pick it up here if you would like. Here were my responses:

If the app is running under the local anonymous account you must have an identical local account
with the same credentials (user ID and password) on the remote machine. This will enable you to
delegate security to the remote machine.

An alternative delegation scenario would be to change the anonymous account under which the app runs
(in IIS) to a domain account (assuming that both machines are in the same domain - if you have one).

I should have mentioned a couple of other issues. First you should be using a UNC path instead of a
mapped drive letter for your linked tables.

Second, you should enable impersonation for the ASP.NET app if you want to delegate security for the
default anonymous account or a selected domain account. Otherwise, the default ASP.NET account will
be delegated (which is ASPNET under Win2K and WinXP).


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Hi,

Thanks for your answer... on both forums :)

I actually feel I have tried all the things you mention here except the part
of using UNC path. Can this be done when linking tables in MS Access?

How can I check that my app is running under the local anonymous account? I
have set IIS 5.0 to use Anonymous access and have the web app to use forms
authentication. The anonymous account is IUSR_<machinename> with a password
that I have set (unchecking the "Allow IIS to control passwords" checkbox).
On the remote machine I have created a user account with the same name as
IUSR on the webserver and also set the same password. I have then entered the
user into a group that has all priviliges on the shared drive.

I have also tried to use another account that was allready on both machines,
without any luck. I am not running a domain and have all PC/servers set for
workgroup.

And all the above said I have tried a similar setup on my local machine with
with the linked tables on a share and it all worked fine. The difference
being as mentioned before. Only difference is that I am logged on the
developer machine with an account that has the same username and password on
the share. So for me it seems to be a IIS 5.1 to IIS 5.0 problem.

But I will try once again to do everything you suggests in order to be sure.
Firstly to try to use UNC paths in Access when linking. Not that I know how
to do this though :)

Again, thanks for the answer and support.

Best regards
PÃ¥l Eilertsen
 
¤ Hi,
¤
¤ Thanks for your answer... on both forums :)
¤
¤ I actually feel I have tried all the things you mention here except the part
¤ of using UNC path. Can this be done when linking tables in MS Access?
¤

Yes, you can link tables using a UNC path.

¤ How can I check that my app is running under the local anonymous account? I
¤ have set IIS 5.0 to use Anonymous access and have the web app to use forms
¤ authentication. The anonymous account is IUSR_<machinename> with a password
¤ that I have set (unchecking the "Allow IIS to control passwords" checkbox).
¤ On the remote machine I have created a user account with the same name as
¤ IUSR on the webserver and also set the same password. I have then entered the
¤ user into a group that has all priviliges on the shared drive.
¤
¤ I have also tried to use another account that was allready on both machines,
¤ without any luck. I am not running a domain and have all PC/servers set for
¤ workgroup.
¤
¤ And all the above said I have tried a similar setup on my local machine with
¤ with the linked tables on a share and it all worked fine. The difference
¤ being as mentioned before. Only difference is that I am logged on the
¤ developer machine with an account that has the same username and password on
¤ the share. So for me it seems to be a IIS 5.1 to IIS 5.0 problem.
¤
¤ But I will try once again to do everything you suggests in order to be sure.
¤ Firstly to try to use UNC paths in Access when linking. Not that I know how
¤ to do this though :)

Use My Network Places and drill down to Microsoft Windows Network. From there you should be able to
select the remote machine and shared resource.

The final key may be to enable impersonation. If it is not currently enabled then your app is
executing under the generic ASPNET account instead of IUSR (or IWAM).

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconimpersonation.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 
The other method of connecting to this datasource would be to create a
system odbc connection.

You can do this through the Data sources (odbc) tool.

To get to this you go to the control panel on the server, then to the
administrative tools, then the datasources wizard is located within.

Once you have setup your odbc connection you just modify the connection
string for the database in your web config.

This is also called a DSN for the connection string see
http://www.connectionstrings.com

Also within access if you link tables you should use this method, this
way it doesn't matter if the database resides locally, or on a server,
your always pointed at the database correctly.

One other thing that this will allow you to acheive is that when you
set up the DSN you can instantly test it, so if you don't have enough
permissions / can't see the database then you see immediatly instead of
having to write code to check for permissions based errors etc.
 
¤ I have written the impersonate=true in the web.config file. Is that sufficient.
¤

Not quite. It should look like the following:

<identity impersonate="true" />


Paul
~~~~
Microsoft MVP (Visual Basic)
 
I was navigating through the Web because I think that I have an identical problem.

I've tried to add 'identity impersonate="true" /' but it seems thta it's not compatible with :

'authentication mode="Forms"'
'forms loginUrl="Login.aspx" timeout="20"'

'/forms'
'/authentication'


How is it possible to manage with both ?

Regards

Daniel Clar (Supelec)
 
Back
Top