Get a Password from Code

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

From code, is it possible to get the current users
password?

I need the ability to rerun Access 2000 and automatically
login the user. I know how to run Access from the
command line and I know how to get the current username.
 
Not that I'm aware of ... I don't think even Admin users can get another
users password (although they can clear passwords).

What are you trying to accomplish? Perhaps someone has ideas ...
 
You can get the >encrypted< password by opening the current workgroup file,
and selecting the [password] (sp?) field from the msysobjects record where
[user] (sp?) = currentuser(). Takes a few lines of code in the the running
database.

Naturally you can't then use that password to log on as that user. (It's the
encrypted version, not the plaintext one.) But you can use it for other
purposes; eg. to see if he has changed it since "last time", thus enforcing
a password expiration scheme; or to see if he has set it to his forname (for
example); or if he has copied someone else's password, etc.

Cheers,
TC
 
Ha ... never thought of that!! Opens up several interesting avenues I've
been mulling over ... thanks TC


TC said:
You can get the >encrypted< password by opening the current workgroup file,
and selecting the [password] (sp?) field from the msysobjects record where
[user] (sp?) = currentuser(). Takes a few lines of code in the the running
database.

Naturally you can't then use that password to log on as that user. (It's the
encrypted version, not the plaintext one.) But you can use it for other
purposes; eg. to see if he has changed it since "last time", thus enforcing
a password expiration scheme; or to see if he has set it to his forname (for
example); or if he has copied someone else's password, etc.

Cheers,
TC


Scott McDaniel said:
Not that I'm aware of ... I don't think even Admin users can get another
users password (although they can clear passwords).

What are you trying to accomplish? Perhaps someone has ideas ...
 
Sorry, msysUSERS record, of course :-)

TC


Scott McDaniel said:
Ha ... never thought of that!! Opens up several interesting avenues I've
been mulling over ... thanks TC


TC said:
You can get the >encrypted< password by opening the current workgroup file,
and selecting the [password] (sp?) field from the msysobjects record where
[user] (sp?) = currentuser(). Takes a few lines of code in the the running
database.

Naturally you can't then use that password to log on as that user. (It's the
encrypted version, not the plaintext one.) But you can use it for other
purposes; eg. to see if he has changed it since "last time", thus enforcing
a password expiration scheme; or to see if he has set it to his forname (for
example); or if he has copied someone else's password, etc.

Cheers,
TC


Not that I'm aware of ... I don't think even Admin users can get another
users password (although they can clear passwords).

What are you trying to accomplish? Perhaps someone has ideas ...

From code, is it possible to get the current users
password?

I need the ability to rerun Access 2000 and automatically
login the user. I know how to run Access from the
command line and I know how to get the current username.
 
scott@NO___Spam-- said:
Not that I'm aware of ... I don't think even Admin users can get another
users password (although they can clear passwords).

What are you trying to accomplish? Perhaps someone has ideas ...
I'm a bit late jumping in, but I have a use for that the password.

While writing a secured multi-user app, I encountered some problems with
record-locking.

Tom Wickerath on group ms.public.access sent me this KB reference
PRB: Jet 4.0 Row-Level Locking Is Not Available with DAO 3.60
http://support.microsoft.com/default.aspx?scid=kb;en-us;306435

As a workaround it was suggested to open a permanent connection to the
backend database from code.
I thought it obvious to create that connection with the current user
credentials.
But opening the connection (in ADO as well as DAO) requires a password
Which I cannot obtain for the currentuser.

Set ws_DAO = DBEngine.CreateWorkspace("Workspace", "user","password",
dbUseJet)

(every example at MS uses either an empty or a hardcoded password)

As a workaround for this, I added a extra user with known credentials
(and limited permissions). But it would be much cleaner if the
currentuser credentials could be reused.

regards
glenn
 
Back
Top