Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Windows Services
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

Report this thread to moderator Post Follow-up to this message
Old Post
PeterW
03-31-05 08:56 PM


Re: Windows Services
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.  T
he
> SQLException thrown also has the following: 	Message	@"Login failed for us
er
> 'aserverName\ZBPL-908R01J-L$'."
>
> I was calling a stored proc with a defined SQL Server user with permission
s
> 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 localSyst
em
> account.
>
> What do I need to do for SQL Server to allow access to the machine?  Creat
e
> the machine as a user and allocate permissions to objects?
>


--
Gerry Hickman (London UK)

Report this thread to moderator Post Follow-up to this message
Old Post
Gerry Hickman
04-01-05 01:55 AM


Re: Windows Services
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)
>

Report this thread to moderator Post Follow-up to this message
Old Post
PeterW
04-01-05 01:55 AM


Re: Windows Services
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.[/colo
r]

Great! Glad it was useful.

--
Gerry Hickman (London UK)

Report this thread to moderator Post Follow-up to this message
Old Post
Gerry Hickman
04-02-05 01:55 AM


Re: Windows Services
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.
> 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 
database.  The 
user 
permissions 
connection 
localSystem 
Create 



Report this thread to moderator Post Follow-up to this message
Old Post
Erik Tamminga
05-24-05 01:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

MSDN archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:01 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.