Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Security / July 2004

Tip: Looking for answers? Try searching our database.

Change password form without user account info showing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LDV - 30 Jul 2004 00:39 GMT
I'm using MS Access 2002 with a secure workgroup using the built in account and permissions routine.  The application has a fairly polished front end application, but for the way passwords are changed.

Currently I have a swithcboard button that opens the MS Access user account form (Running macro - DoCmd.RunCommand acCmdUserAndGroupAccounts) where a user can change his/her password on the applicable tab.  While the common users cannot change account info I'd really like for them just to get the change password tab without having to click on the tab and without seeing any other security account information or settings.

I don't mind making special forms, macros or such to do this, but I can't seem to figure out how to do this without re-inventing my own security schema, which I have no interest in doing.

Thanks,
Lynn Trapp - 30 Jul 2004 14:11 GMT
You can create your own form with 2 unbound text boxes -- one for user name
and one for password (set it's format mask to password). Add a button with a
call to the following function from the Security FAQ.

 Function faqChangePassword (ByVal strUser As String, _
     ByVal strPwd As String) As Integer

     Dim ws As Workspace
     Dim usr As User

     Set ws = DBEngine.Workspaces(0)
     Set usr = ws.Users(strUser)
  usr.NewPassword "", strPwd
 End Function

The function call can look something like this:

Private Sub cmdChangePassword_Click()
Dim v_PW_Return As Integer
v_PW_Return = faqChangePassword(Me.txtUserName, Me.txtPassword)
End Sub

Signature

Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm

> I'm using MS Access 2002 with a secure workgroup using the built in account and permissions routine.  The application has a fairly polished
front end application, but for the way passwords are changed.

> Currently I have a swithcboard button that opens the MS Access user account form (Running macro - DoCmd.RunCommand acCmdUserAndGroupAccounts)
where a user can change his/her password on the applicable tab.  While the
common users cannot change account info I'd really like for them just to get
the change password tab without having to click on the tab and without
seeing any other security account information or settings.

> I don't mind making special forms, macros or such to do this, but I can't seem to figure out how to do this without re-inventing my own security
schema, which I have no interest in doing.

> Thanks,
Lynn Trapp - 30 Jul 2004 14:56 GMT
LDV,
I forgot to mention that to use the function below the user must be a member
of the Admins group. If they are not you will need to use the following
function and add the OldPassword parameter to the call.

Function faqChangePassword(ByVal strUser As String, _
     ByVal strPwd As String, ByVal strOldPwd As String) As Integer

     Dim ws As Workspace
     Dim usr As User
On Error GoTo err_ChangePassword

     Set ws = DBEngine.Workspaces(0)
     Set usr = ws.Users(strUser)
  usr.NewPassword strOldPwd, strPwd
err_ChangePassword:
 If Err.Number = 3033 Then
 MsgBox "You do not have permission to modify passwords. Please contact
your system administrator."
 End If

 End Function

Signature

Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm

> You can create your own form with 2 unbound text boxes -- one for user name
> and one for password (set it's format mask to password). Add a button with a
[quoted text clipped - 34 lines]
> >
> > Thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.