Private Db As Database
Private rs As Recordset
Private Wks As Workspace
Private StrConexServer As String
Private Sub Form_Load()
StrConexServer = "ODBC;DSN=MeuBanco;DESC=MySQL ODBC 3.51 Driver DSN;DATABASE=BancoTeste;SERVER=EndServidor;UID=root;PASSWORD=senha;PORT=3306;OPTION=3;STMT=;"
Set Wks = DBEngine.CreateWorkspace("AreaODBC", "admin", "", dbUseODBC)
Set Db = Wks.OpenDatabase("MeuBanco", dbDriverNoPrompt, , StrConexServer)
Set rs = Db.OpenRecordset("SELECT * FROM clientes", dbOpenDynamic)
End Sub
Segue o fonte de um sistema meu, usando MySql...
T+,