Dim myConnection As ADODB.Connection
Dim newUser As ADOX.User
Dim strSQL As String
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:\VBA.mdb;User ID=John;Password=;"
strSQL = "CREATE USER joe [mycat] NULL"
.Execute (strSQL)
End With
End Sub
|