|
|
| PeterW 2005-03-31, 3:56 pm |
| Are there any C# Discussion Groups that handle the development of Windows
Services? Nearly every other grouping seems to be covered but this.
I have an issue with a Windows Service accessing a SQL Server database. The
SQLException thrown also has the following: Message @"Login failed for user
'aserverName\ZBPL-908R01J-L$'."
I was calling a stored proc with a defined SQL Server user with permissions
on selected objects in a particular database configured in the connection
string. It appeared to ignore that and use the machine name instead
presumably because the Windows Service was configured to use the localSystem
account.
What do I need to do for SQL Server to allow access to the machine? Create
the machine as a user and allocate permissions to objects?
--
PeterW
| |
| Gerry Hickman 2005-03-31, 8:55 pm |
| Hi,
I don't think you'll get much joy from the C# and .NET community on this
as they're still in nappies.
If you're using "Windows Integrated Authentication", one thing you could
try, is defining a special domain account "SQLAccess" (or whatever) and
tell your service to run as that account. Make sure SQL server has that
account in it's list of allowed logins.
PeterW wrote:
> Are there any C# Discussion Groups that handle the development of Windows
> Services? Nearly every other grouping seems to be covered but this.
>
> I have an issue with a Windows Service accessing a SQL Server database. The
> SQLException thrown also has the following: Message @"Login failed for user
> 'aserverName\ZBPL-908R01J-L$'."
>
> I was calling a stored proc with a defined SQL Server user with permissions
> on selected objects in a particular database configured in the connection
> string. It appeared to ignore that and use the machine name instead
> presumably because the Windows Service was configured to use the localSystem
> account.
>
> What do I need to do for SQL Server to allow access to the machine? Create
> the machine as a user and allocate permissions to objects?
>
--
Gerry Hickman (London UK)
| |
| PeterW 2005-03-31, 8:55 pm |
| Gerry
I agree. After I posted this article I changed the account that the service
runs under to a user account being my own which has local administrator
rights. The SQL user used for the connection string is a specially defined
user having priviledges just to the objects that the service needs to write
to. All this is in a service that runs a filewatcher that fires off new
threads to process the dropped files.
All works beautifully. So to roll it out I need to talk to the systems
administrators to create a user account just for the service as you suggest.
That is a setup issue.
Thanks for your input. It helped to confirm after the event that the
choices I had deduced were indeed valid.
cheers
"Gerry Hickman" wrote:
> Hi,
>
> I don't think you'll get much joy from the C# and .NET community on this
> as they're still in nappies.
>
> If you're using "Windows Integrated Authentication", one thing you could
> try, is defining a special domain account "SQLAccess" (or whatever) and
> tell your service to run as that account. Make sure SQL server has that
> account in it's list of allowed logins.
>
> PeterW wrote:
>
>
>
> --
> Gerry Hickman (London UK)
>
| |
| Gerry Hickman 2005-04-01, 8:55 pm |
| Hi Peter,
> All works beautifully. So to roll it out I need to talk to the systems
> administrators to create a user account just for the service as you suggest.
Great! Glad it was useful.
--
Gerry Hickman (London UK)
| |
| Erik Tamminga 2005-05-24, 8:56 am |
| Peter,
If you specify a username/password combination in your connection string you
should not have to run the servers using an special SQLAccess-account!
I use a connectionstring like the following for my services:
"Data Source=SQLSERVERNAME; Initial Catalog=DATABASENAME; User ID=USERID;
Password=PASSWORD;"
This works like a charm and doesn't require a special sql-access account..
Erik
"PeterW" <nspw@noemail.nospam> wrote in message
news:16274C08-CBC2-4240-93AB-9CF1E754EBC5@microsoft.com...
> Gerry
>
> I agree. After I posted this article I changed the account that the
service
> runs under to a user account being my own which has local administrator
> rights. The SQL user used for the connection string is a specially
defined
> user having priviledges just to the objects that the service needs to
write
> to. All this is in a service that runs a filewatcher that fires off new
> threads to process the dropped files.
>
> All works beautifully. So to roll it out I need to talk to the systems
> administrators to create a user account just for the service as you
suggest.[color=darkred]
> That is a setup issue.
>
> Thanks for your input. It helped to confirm after the event that the
> choices I had deduced were indeed valid.
>
> cheers
>
> "Gerry Hickman" wrote:
>
Windows[color=darkred]
database. The[color=darkred]
user[color=darkred]
permissions[color=darkred]
connection[color=darkred]
localSystem[color=darkred]
Create[color=darkred]
|
|
|
|