Conectando um Banco de Dados com Segurança em Nível de Usuário.
Segue:
Sub Open_WithUserSecurity()Dim conn As ADODB.ConnectionDim strDb As StringDim strSysDb As StringOn Error GoTo ErrorHandlerstrDb = CurrentProject.Path & "\Bernardess\mydb.mdb"strSysDb = CurrentProject.Path & "\Security.mdw"Set conn = New ADODB.ConnectionWith conn.Provider = "Microsoft.Jet.OLEDB.4.0;".ConnectionString = "Data Source=" & strDb & ";" & _"Jet OLEDB:System Database=" & strSysDb.Open , "Developer", "WebMaster"End Withconn.CloseSet conn = NothingExit SubErrorHandler:MsgBox Err.Number & ": " & Err.DescriptionEnd Sub
Tags: VBA, Access, connect, SQL, database, Connecting, Server, Data Source, Opening, Secured, User Level,
Nenhum comentário:
Postar um comentário