How can I OpenDatabase without UID and PWD!!

How can I OpenDatabase without UID and PWD!!

Post by Rukesh Pate » Fri, 13 Feb 1998 04:00:00



Hi,
I have an NT service which opens an SQL SERVER database using ADO. To
open the database I need a UID and PWD. Since, I am running it from an
NT service I can't display any dialogbox. One way to solve this is to
hard code the UID and PWD in the code OR to store it in the registry.
Obvisouly, this is unacceptable.

One way I can see of solving this, is to, start the service in a user
account (not System Account) and use this security context to open the
database. Unfortunatly, I can only have the SID and there is no way of
using SID to open database.

Got any better solution?

Thanks,
Rukesh

 
 
 

How can I OpenDatabase without UID and PWD!!

Post by Matt Neerinc » Mon, 16 Feb 1998 04:00:00


If you use SQL Server's  Windows NT Integrated login (uses NT security
information to
validate user) then you can map any user account to any SQL Server user.
You can
set up SQL Server to use both (this is called Mixed) as well so you won't
break other
applications that use a regular userid/password login.

Matt


>Hi,
>I have an NT service which opens an SQL SERVER database using ADO. To
>open the database I need a UID and PWD. Since, I am running it from an
>NT service I can't display any dialogbox. One way to solve this is to
>hard code the UID and PWD in the code OR to store it in the registry.
>Obvisouly, this is unacceptable.

>One way I can see of solving this, is to, start the service in a user
>account (not System Account) and use this security context to open the
>database. Unfortunatly, I can only have the SID and there is no way of
>using SID to open database.

>Got any better solution?

>Thanks,
>Rukesh


 
 
 

How can I OpenDatabase without UID and PWD!!

Post by Skip Sailo » Sun, 22 Feb 1998 04:00:00




Quote:>Hi,
>I have an NT service which opens an SQL SERVER database using ADO. To
>open the database I need a UID and PWD. Since, I am running it from an
>NT service I can't display any dialogbox. One way to solve this is to
>hard code the UID and PWD in the code OR to store it in the registry.
>Obvisouly, this is unacceptable...

This is not obvious to me.  If I have a service that requires access
to secure resources I have to treat the service like any other user of
secure resources, don't I?  This means telling the service what his
user name and password is.

This also means changing the service's password frequently and making
sure that the password is not something easily guessed.

I trust my programs to keep thier passwords secret more than I trust
my human users.  Are you worried that some hack will break in to your
code repository and read the variable value assigned to the PWD, or
are you worried that there are hacks listening to your network traffic
for passwords?  Or are you reluctant to spend the time it takes to
manage the service as yet another user?