Sub addJetSqlUser() : Microsoft Jet « Access « VBA / Excel / Access / Word






Sub addJetSqlUser()

 
   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

 








Related examples in the same category

1.Include the database version information with the JetOLEDB:Engine Type property
2.connect to JET
3.Read table schema
4.Connection String to Access database
5.Use Recordset.Support to check the supported features
6.Create new database
7.Open a worksheet through OLEDB
8.Opening a Microsoft Jet Database in Read/Write Mode
9.A Simple Connection Example