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
|