Getting at SQL Login Info...

N

ng

This security thing is sort of taking for a loop a little. We have the
SYSTEM login id. what My VBA/Access script returns when you use si.username

But my question, is when I log into an access database, and it has to
reconnect with the SQL server, it asks for a username and a password there,
how do retrieve THOSE values?

Thanks in advance!

-Brian P.
 
R

Rick Brandt

ng said:
This security thing is sort of taking for a loop a little. We have
the SYSTEM login id. what My VBA/Access script returns when you use
si.username

But my question, is when I log into an access database, and it has to
reconnect with the SQL server, it asks for a username and a password
there, how do retrieve THOSE values?

Thanks in advance!

-Brian P.

If you set up the SQL Server to use Trusted Connections then it won't ask
for those. It will just "know" who the user is based on their network
credentials. If you can't use Trusted Connections then the user will have
to supply those values as they do not exist as environment variables that
you can retrieve.
 
N

ng

Let's see here, why didn't I want to use trusted connections? THere was
some reason.. Well, first of all our AD network isn't really set up yet,
we're still 1/2 in the old NT days, in some cases i have 6 people using the
same logon account for the network. Everyone uses "service2" It blows my
mind. Even if I create real users for these people with their names! I
don't want to bring their work to a halt by deleting that username, but it
might be necessary to get a handle on this. If eveyone WAS using their
right login ID< and I could um, "Trust" that, then Trusted connections
wouldn't be problem, I guess the problem I'm facing is I can't Trust every
connection I find.

I can't believe I'm the first one who wanted to query what is in that SQL
login box.. there must be a way to write a stored procedure to return it, or
something.. I just won't take no for an answer here! ;)

Thanks Rick.

-B
 
D

Dan Artuso

If you were able to get the password, sql server wouldn't be very secure, now would it!
If you're using linked tables, you can store the authentication credentials with the link so you're not always prompted.
 
V

Van T. Dinh

Not the Password but you can Use T-SQL function CURRENT_USER() or
SESSION_USER or SYSTEM_USER or USER_NAME() in a Pass-Through Query to
retrieve the log-in.

I think they are slightly different so you need to check the SQL Server
B.O.L. (Books On Line) on the above T-SQL functions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top