Here is how I answered a similar question some time ago. If you have some
coding skils, you should be able to take it from here. But if none of this
makes any sense at all, you'd be better to say, "It can't be readily done in
Access".
I am using Access 2002 workgroup file for security. How
can I give users a flag when it has been more than x days
since they last changed their passsword?
You'll need to code it manually. Perhaps something like this (in
pseudo-code):
on system startup:
find user in table;
if not found
add entry with today's date & (encrypted) pw;
else ' found.
see if (encrypted) pw changed;
if yes
update date to today's
else ' (encrypted) pw not changed.
check date difference;
if > limit, issue a warning.
endif
endif
This assumes you have a table containing (for each user):
UserName (primary key)
Password (encrypted)
DateLastChanged
To get a user's encrypted password, try this: UNTESTED, cos I don't have
Access here to check:
dim db as database, rs as recordset
set db=dbengine.opendatabase(syscmd(acsyscmdgetworkgroupfile))
set rs=db.openrecordset ( _
"select password from msysusers" & _
" where user=""" & currentuser() & """"
debug.print rs![password]
set rs=nothing
set db=nothing
NOTE: I'm not sure of the following names. You'll have to check them out for
yourself:
- "acsyscmdgetworkgroupfile" constant;
- "user" column name.
The code above, is NOT a security hole. It only gives you the user's
encrypted< password. You can not log-on, using that version. You need the
unencrypted version to log-on. And there is no way (erm....) to get the
unencrypted version, from the encrypted one.
As for changing the user's password, check the NewPassword method in online
help.
HTH,
TC