Views

Histats

Vitrine

VBA Access Basic - Usando o OLEDB para conectar arquivos MDB - Use OLEDB to connect with mdb file

Conectando arquivos MDB.

Segue:


'Microsoft ActiveX Data Objects Recordset 2.7 Library
Sub ConnectionExample1()
   Dim conn As ADODB.Connection
   Set conn = New ADODB.Connection

   With conn
      Let .Provider = "Microsoft.Jet.OLEDB.4.0;"
      Let .ConnectionString = "Data Source=" & _
        CurrentProject.Path & "\mydb.mdb"
   End With

   conn.Open

   MsgBox "Conexão foi aberta!"

   conn.Close

   Set conn = Nothing

   MsgBox "Conexão foi Fechada!"
End Sub

Tags: VBA, Access, connect, SQL, database,  Connecting, Server, Data Source, ADODB, SQLOLEDB, MDB,


✔ VBA Brazil®

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