[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.odbcnet

Can't open a OLE DB database connection across a network

Robin Prosch via .NET 247

5/20/2005 4:06:00 PM

Help,
I've got a dotnet application running on a Win 2000 server, IIS 5.0 and asp.net 1.1. Most of this app is backed by SQL Server 2000. But I am forced to pull some information from a myriad of MS Access databases located on another server. The only way that I know how to do this is by simply using the mapped network drive in the OLE DB connection string to these Access databases.

To test this theory, I created a folder on the remote machine and stuck a ?test? Access database in it. I gave every permission I could think of to this folder and database; ie everyone, system, etc, etc. However, nothing I try seems to work. Every time I try to view my app in a browser, I get the error:


The Microsoft Jet database engine cannot open the file 'P:\myfolder\mydb.mdb'. It is already opened exclusively by another user, or you need permission to view its data.


The problem seems to be entirely related to the network. Point to an exact copy on the local machine and everything works fine. The test database is not open or locked. No workgroup has been assigned to it.

From the information I?ve found, it seems this error is caused by security and sharing issues. But, as I?ve said, I?ve tried to give every permission and share I could think of to the test folder and database. Nothing works short of moving everything to the same machine. I did get this one bit of advice from someone,

?When your code executes inside IIS 5.0, it's running as the 'ASPNET' user account, which only exists on that local machine. Chances are the share does not have permissions defined for this user. The only way I know of to get this to work is to set the two machines up in the same domain and use impersonation/delegation to let the code running as the ASPNET user pretend to be a domain user that has the authority to access the share.?

?but none of this makes sense to me.


Can anyone who has experienced this please walk me through the steps to getting this thing to work across a network. I have got to figure it out somehow?????!!


Many thanx


--------------------------------
From: Joe Blanchard

-----------------------
Posted by a user from .NET 247 (http://www.dotn...)

<Id>zgBmuV8HfE2lgWByg7g7LA==</Id>
2 Answers

Paul Clement

5/23/2005 3:34:00 PM

0

On Fri, 20 May 2005 09:06:28 -0700, Joe Blanchard via .NET 247 <anonymous@dotnet247.com> wrote:

&#164; Help,
&#164; I''ve got a dotnet application running on a Win 2000 server, IIS 5.0 and asp.net 1.1. Most of this app is backed by SQL Server 2000. But I am forced to pull some information from a myriad of MS Access databases located on another server. The only way that I know how to do this is by simply using the mapped network drive in the OLE DB connection string to these Access databases.
&#164;
&#164; To test this theory, I created a folder on the remote machine and stuck a ?test? Access database in it. I gave every permission I could think of to this folder and database; ie everyone, system, etc, etc. However, nothing I try seems to work. Every time I try to view my app in a browser, I get the error:
&#164;
&#164;
&#164; The Microsoft Jet database engine cannot open the file ''P:\myfolder\mydb.mdb''. It is already opened exclusively by another user, or you need permission to view its data.
&#164;
&#164;
&#164; The problem seems to be entirely related to the network. Point to an exact copy on the local machine and everything works fine. The test database is not open or locked. No workgroup has been assigned to it.
&#164;
&#164; From the information I?ve found, it seems this error is caused by security and sharing issues. But, as I?ve said, I?ve tried to give every permission and share I could think of to the test folder and database. Nothing works short of moving everything to the same machine. I did get this one bit of advice from someone,
&#164;
&#164; ?When your code executes inside IIS 5.0, it''s running as the ''ASPNET'' user account, which only exists on that local machine. Chances are the share does not have permissions defined for this user. The only way I know of to get this to work is to set the two machines up in the same domain and use impersonation/delegation to let the code running as the ASPNET user pretend to be a domain user that has the authority to access the share.?
&#164;
&#164; ?but none of this makes sense to me.
&#164;
&#164;
&#164; Can anyone who has experienced this please walk me through the steps to getting this thing to work across a network. I have got to figure it out somehow?????!!
&#164;
&#164;

If you''re trying to access the database located on a remote resource (from ASP.NET) then it''s a
security delegation problem. See if the following helps:

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


Paul
~~~~
Microsoft MVP (Visual Basic)

Dave F.

6/12/2005 3:18:00 AM

0

Hi Joe,

I struggled for days with this issue. Turns out that it is a real pain in
the caboose. It''s an issue of granting ASP.NET rights to the remote folders.
I finally found my answer at
http://www.codeproject.com/aspnet/Sec_Run_ASP.... You must also be
sure to use the UNC path to your mdb files, not a mapped drive path. This
was the last piece of the puzzle for me.

Dave

"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
news:ert391hc3bsr28alht0cot7mf35qjej2r8@4ax.com...
> On Fri, 20 May 2005 09:06:28 -0700, Joe Blanchard via .NET 247
> <anonymous@dotnet247.com> wrote:
>
> &#164; Help,
> &#164; I''ve got a dotnet application running on a Win 2000 server, IIS 5.0 and
> asp.net 1.1. Most of this app is backed by SQL Server 2000. But I am
> forced to pull some information from a myriad of MS Access databases
> located on another server. The only way that I know how to do this is by
> simply using the mapped network drive in the OLE DB connection string to
> these Access databases.
> &#164;
> &#164; To test this theory, I created a folder on the remote machine and stuck
> a ?test? Access database in it. I gave every permission I could think of
> to this folder and database; ie everyone, system, etc, etc. However,
> nothing I try seems to work. Every time I try to view my app in a browser,
> I get the error:
> &#164;
> &#164;
> &#164; The Microsoft Jet database engine cannot open the file
> ''P:\myfolder\mydb.mdb''. It is already opened exclusively by another user,
> or you need permission to view its data.
> &#164;
> &#164;
> &#164; The problem seems to be entirely related to the network. Point to an
> exact copy on the local machine and everything works fine. The test
> database is not open or locked. No workgroup has been assigned to it.
> &#164;
> &#164; From the information I?ve found, it seems this error is caused by
> security and sharing issues. But, as I?ve said, I?ve tried to give every
> permission and share I could think of to the test folder and database.
> Nothing works short of moving everything to the same machine. I did get
> this one bit of advice from someone,
> &#164;
> &#164; ?When your code executes inside IIS 5.0, it''s running as the ''ASPNET''
> user account, which only exists on that local machine. Chances are the
> share does not have permissions defined for this user. The only way I know
> of to get this to work is to set the two machines up in the same domain
> and use impersonation/delegation to let the code running as the ASPNET
> user pretend to be a domain user that has the authority to access the
> share.?
> &#164;
> &#164; ?but none of this makes sense to me.
> &#164;
> &#164;
> &#164; Can anyone who has experienced this please walk me through the steps to
> getting this thing to work across a network. I have got to figure it out
> somehow?????!!
> &#164;
> &#164;
>
> If you''re trying to access the database located on a remote resource (from
> ASP.NET) then it''s a
> security delegation problem. See if the following helps:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsent7/html/vxconaspnetdele...
>
>
> Paul
> ~~~~
> Microsoft MVP (Visual Basic)