Views

Histats

Vitrine

VBA Access Basic - Conectando um Banco de Dados com Nome e Usuário - Connect to database with user name and password

Conectando um Banco de Dados com Segurança em Nível de Usuário.

Segue:


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:\Bernardess\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

Tags: VBA, Access, connect, SQL, database, Connecting, Server, Data Source, ADOX, Opening, Secured, User Level, Conectando, Banco de Dados, Nome, Usuário, user, name, password


✔ VBA Brazil®

✔ VBA Brazil®
brazilsalesforceeffectiveness@gmail.com
Related Posts Plugin for WordPress, Blogger...
diHITT - Notícias