Integrated Security and SQL Server does not exist or access denied.

I'm using integrated security and trying to access the SQ database in dot net. my OS is XP and i've SQL Server 2000 Developer Edition installed. If write following connection string, it works

"Persist Security Info=False;Integrated Security=SSPI;database=DBName;data source=(local);"

But if i use the same using name or IP Address of the server it gives an error stating

"SQL Server does not exist or access denied."

Same happens if access it from some other machine. because in that case also either i'm using ip address of my machine or the name of the machine as server.

It works well through query analyzer.

What could be the reason. pls. help

Thanks and regards,
Jigyasa
jayakulAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nauman_ahmedCommented:
Try the following connection string:

Data Source=MY_SERVER_OR_SERVER_IP,1433;Network Library=DBMSSOCN;Initial Catalog=MY_DB;User ID=sa;Password=password;">

for more information visit http://www.connectionstrings.com

HTH, Nauman.


raterusCommented:
exactly what ip are you using, it is the local IP of the webserver right? (Since you say (local) works)
Geo123Commented:
ok I will throw my 2 pence in ring

SSPI doesnt that mean you use your Windows login username (and password) to log into SQL server??

When it worked in Query analyser what username and password did you use to run the connection on?

Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jayakulAuthor Commented:
For query analyzer i'm using windows authentication and it works

And i need to use windows users to log on to SQL Database
nauman_ahmedCommented:
It will work from the Windows APP because all the windows application uses the credentials of current logged in user.  In case of ASP.NET, the worker process aspnet_wp.exe runs under the privilege of ASPNET user account that is not allowed to access the system processes.  You will need to provide the user name and password to access the SQL server from ASP.NET application under the default configuration.

HTH, Nauman.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Geo123Commented:
just setup a new user and password in Database...... then pass this in sonnection string

cheers George
jayakulAuthor Commented:
nauman_ahmed is right. I've used

<identity impersonate="true" />

in Web.config file. It's working now.

Thanx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.