Create user for Access database : Access Environment « Access « VBA / Excel / Access / Word






Create user for Access database

 
Sub addUser()
   Dim myConnection As ADODB.Connection
   Dim newUser As ADOX.User
   Set myConnection = New ADODB.Connection

   With myConnection
        .Provider = "Microsoft.Jet.OLEDB.4.0"
        .Properties("Jet OLEDB:System database") = "C:\demo.mdw"
        .Open "Data Source=c:|BegVBA\store.mdb;User ID=JohnSmith;Password=;"
        .Execute ("CREATE USER jane [mycat] NULL")
       End With
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.Add or delete users