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:\r.mdb;" & _
"Jet OLEDB:System database=C:\r.mdw;" & _
"User id=john;Password=;"
Set newUser = New ADOX.User
newUser.Name = userName
myConnection.Users.Append newUser
myConnection.Users(newUser.Name).changePassword "", newPassword
End Sub
|