Bom dia pessoal,
Estou com um problema ao tentar acessar os dados no banco de dados que eu criei, aparece o erro "3709", já tentei desinstalar e instalar o ODBC e nada.
Public MiConexao As ADODB.Connection
Public Rs As New ADODB.Recordset
Sub Conecta()
Set MiConexao = New ADODB.Connection
With MiConexao
.Provider = "Microsoft.ACE.OLEDB.15.0"
.ConnectionString = "Data Source=" & ThisWorkbook.Path & "\BD_Sistema.accdb"
End With
End Sub
Private Sub UserForm_Initialize()
Call Conecta
Set Rs = New Recordset
Rs.Open "SELECT * FROM Clientes", MiConexao, adOpenKeyset, adLockBatchOptimistic, adCmdText
End Sub
Estou com um problema ao tentar acessar os dados no banco de dados que eu criei, aparece o erro "3709", já tentei desinstalar e instalar o ODBC e nada.
Public MiConexao As ADODB.Connection
Public Rs As New ADODB.Recordset
Sub Conecta()
Set MiConexao = New ADODB.Connection
With MiConexao
.Provider = "Microsoft.ACE.OLEDB.15.0"
.ConnectionString = "Data Source=" & ThisWorkbook.Path & "\BD_Sistema.accdb"
End With
End Sub
Private Sub UserForm_Initialize()
Call Conecta
Set Rs = New Recordset
Rs.Open "SELECT * FROM Clientes", MiConexao, adOpenKeyset, adLockBatchOptimistic, adCmdText
End Sub