Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Linked Server Windows Service...

Author  Topic 

AProgrammer
Starting Member

9 Posts

Posted - 2008-05-30 : 02:13:30
Hello everyone,

I have a stored procedure that I wrote in sql server 2000 database located on my computer. That stored procedure grabs data from another linked server (sql server 2000) database. I used that stored procedure in my C# windows application and it returned all the necessary information properly.

But as soon as I changed my application from "Windows Application" to "Windows Service", I got the following error.

"Login failed for user 'MyDomain\MyComputerName$'"

My connection string is the following.

"server=(local);database=myData;uid=admin;password=admin13445;Trusted_Connection=Yes"

"admin" has complete rights on the linked server.

What am I doing wrong?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-30 : 02:25:58
You can not provide a userid/password and also use Windows authentication. It's one or the other. When you specify userid/password, you are telling it to use SQL authentication. But then you've set Trusted_Connection to true, so then you're saying use Windows authentication.

But at any rate, does the MyDomain\MyComputerName$ account have access to the remote server inside SQL Server?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page

AProgrammer
Starting Member

9 Posts

Posted - 2008-05-30 : 03:03:46
Hi Tara,

Well, I just got it working... I removed Trusted_Connection=Yes from the connection string. "admin" is a user which has full rights on the server. I prefered using that.

Thanks for the clue. I was not aware that I was mixing two different things and ultimately getting nowhere.


quote:
Originally posted by tkizer

You can not provide a userid/password and also use Windows authentication. It's one or the other. When you specify userid/password, you are telling it to use SQL authentication. But then you've set Trusted_Connection to true, so then you're saying use Windows authentication.

But at any rate, does the MyDomain\MyComputerName$ account have access to the remote server inside SQL Server?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx

Go to Top of Page
   

- Advertisement -