Connect to database on other computer

C

Chris Zopers

Hello,

I host an ASP.NET application on a computer and from that computer, I
want to connect to a database on an other computer. When I place the
database on the same computer, everything works just fine, but when I
place the database on the other computer, I can't connect to it. I've
tried just about anything with security and impersonation, but nothing
seems to work. Does anyone have a solution for this problem?

Greetings,
Chris.
 
P

Paul Clement

¤ Hello,
¤
¤ I host an ASP.NET application on a computer and from that computer, I
¤ want to connect to a database on an other computer. When I place the
¤ database on the same computer, everything works just fine, but when I
¤ place the database on the other computer, I can't connect to it. I've
¤ tried just about anything with security and impersonation, but nothing
¤ seems to work. Does anyone have a solution for this problem?

It's failing on the delegation of credentials to the other machine.

What is the authentication setting for the web application under IIS?

Are you using impersonation?

What type of database are you using?


Paul
~~~~
Microsoft MVP (Visual Basic)
 
C

Chris Zopers

Hello,

I use an MS Access database. I've tried impersonation with a user
loginname and password that has full permissions. With that useraccount
I can directly open the MS Access database, but when my ASP.NET
application impersonates that user, it still won't connect to that same
MS Access database.

Greetings,
Chris.
 
P

Paul Clement

¤ Hello,
¤
¤ I use an MS Access database. I've tried impersonation with a user
¤ loginname and password that has full permissions. With that useraccount
¤ I can directly open the MS Access database, but when my ASP.NET
¤ application impersonates that user, it still won't connect to that same
¤ MS Access database.

If you're using Integrated Windows authentication for your web app, credentials cannot be delegated
without implementing Kerberos. However you should be able to use Basic authentication assuming that
you're logging in with a domain account that has the appropriate permissions for the resource (which
appears to be what you've indicated).

You should also be using a UNC path to the database in your connection string and not a path mapped
to a local drive letter.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
D

Dave F.

Hi Chris,

I had a similar problem accessing data on a remote server. I had to setup a
user account on the remote server and give it full permissions on the folder
that contains the mdb file.

Then I had to create an identical user on the IIS server (same username and
password) and give basic permissions to the ASP.NET application folder. Then
in the IIS manager you need to open the properties of your application, make
sure Anonymous login is checked. Then edit the Account used for anonymous
access to reflect your new username and password. Make sure that the Allow
IIS to control password box is unchecked.Put a check in Basic authentication
and fill in the Default domain and Realm. Be sure the Integrated Windows
authentication box is checked and click OK.

You can review the following article from CodeProject to get an idea of what
else to do. Be sure to click the MSDN link in this article. It gives you
instructions on how to setup user permissions on other folders.

http://www.codeproject.com/aspnet/Sec_Run_ASPNET_WP.asp

Hope this helps
 
C

Chris Zopers

Hi there,

Thanks for your answers. I've been away some weeks, so haven't had the
chance to answer back. I use a drive in my connectionstring, maybe
that's the problem. Hope your solution works....

Thanks,
Chris.
 

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

Members online

No members online now.

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top