Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with accessing remote database on a network

Status
Not open for further replies.

jn03

Programmer
Jan 16, 2003
45
0
0
CA
Hi all,

I have my asp.net application on machine A and trying to access to the database on machine B on the same network. Can someone help me on how to configure both machines to make this work?

Machine B already has ASPNET account which provides access rights.
I also have set
<identity impersonate=true>
in my webconfig file, but it still doesn't work.

Thanks in advance.
 
You may need to set the <authentication mode=&quot;Windows&quot;/> in your web.config file.

By default it is set to <authentication mode=&quot;None&quot;/> and the other server does not know the user.

Another thing you might need to do is set the security on your connection string to ...

sConn = &quot;Server=&quot; & SQLServerName & &quot;;&quot;
sConn &= &quot;Database=&quot; & DatabaseName & &quot;;&quot;
sConn &= &quot;Connection Timeout=90;&quot;
' use NT user security
sConn &= &quot;Integrated Security=SSPI;&quot;

or your other option is to create a user in the database and hardcode the &quot;userid=someuser; PWD=password;&quot; into your connection string and give that user access to the database


HTH :)


George Oakes
Goakes@TiresPlus.com = Programmer
George@1-Specialday.com = Mobile DJ
Check out this awsome .Net Resource!
 
Another thing just hit me, by default the ASPNET account is unique for that machine. usualy like MachineName\ASPNET

and that account may not be accessable from the other server. I don't think the other SQL database would recognize that account at all. Just something I found doing basicaly the same thing.

I have a webserver on one machine and a seperate database server on another, and I had to hardcode a USerID and PWD into the connection string.

Just a thought

George Oakes
Goakes@TiresPlus.com = Programmer
George@1-Specialday.com = Mobile DJ
Check out this awsome .Net Resource!
 
Thanks George, for the inputs, but it still doesn't work.
I already had <authentication mode=&quot;Windows&quot;/>
As for the username and password, I'm not sure since I'm using Visual FoxPro as the database.

My guess is it has something to do with the aspnet account on both machines A and B, but I don't know how :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top