Conectando um Banco de Dados com Segurança em Nível de Usuário.
Segue:
Sub addUser()Dim myConnection As ADOX.CatalogDim newUser As ADOX.UserDim userName As StringDim newPassword As StringSet 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 newUsermyConnection.Users(newUser.Name).changePassword "", newPasswordEnd 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
Nenhum comentário:
Postar um comentário