Hola Tienes Instalado el MySQL ya?
http://dev.mysql.com/downloads/mysql/5.0.htmlen esa pagina en la seccion de Conectores descargas el driver ODBC
lo instalas y creas el DSN y te conectas como cualquier base de datos
Aqui hay un Ejemplo con RDO
http://www.elguruprogramador.com.ar/zonas/ver.asp?cod=115aqui hay un ejemplo con ADO espero que sea entendible
'En el Form
Private Sub Form_Load()
Dim lo_rs as RecordSet
Dim ls_ap_pat as String
gs_CnnStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;Database=data;USER=sistema;PWD=123456;OPTION=3"
set go_Cnn=ConectarBD(gs_CnnStr)
if go_Cnn.State>1 then
set lo_rs=Consulta("SELECT * FROM t_Nomina ap_pat='"& ls_ap_pat &"'")
With lo_rs
do while not .EOF
MsgBox("Resultado",![nombre])
.MoveNext
loop
end with
else
MsgBox("No Hay conexion con la Base de datos")
end if
End Sub
'============================================================================
'En Modulo
Public go_Cnn as Connection
Public gs_CnnStr as String
Function ConectarBD(ByVal as_cnnstr As String) As Connection
On Error Resume Next
Dim lo_cnn As Connection
Set lo_cnn = New Connection
lo_cnn.Open as_cnnstr
lo_cnn.CursorLocation = adUseClient
Set ConectarBD = lo_cnn
End Function
'==========================================================================
Function Consulta(as_SQL As String, ByVal ao_cnn As Connection) As Recordset
On Error Resume Next
Dim lo_rs As Recordset
Set lo_rs = New Recordset
lo_rs.Open as_SQL, lo_cnn
Set Consulta = lo_rs
End Function
Otras paginas de utilidad
http://www.connectionstrings.com/http://www.elguille.info/vb/bases/ADO/indiceADO.htmhttp://www.google.com/ Saludos
Mexicali B.C.