Add or delete users : Access Environment « Access « VBA / Excel / Access / Word






Add or delete users

 
Sub addUser()

   Dim myConnection As ADOX.Catalog
   Dim newUser As ADOX.User
   Dim userName As String
   Dim newPassword As String
   Set myConnection = New ADOX.Catalog

   myConnection.ActiveConnection = "Provider = Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=C:\store.mdb;Jet OLEDB:System database=C:\store.mdw;User id=smith;Password=;"

   Set newUser = New ADOX.User
   newUser.Name = userName
   myConnection.Users.Append newUser
   myConnection.Users(newUser.Name).changePassword "", newPassword
End Sub

 








Related examples in the same category

1.Changing the Access Environment
2.Use Access Special Keys
3.Changing Options
4.Creating a Password Programmatically with SQL command
5.Change the password of the database from smith to jones
6.Create user for Access database