MySQL Forums
Forum List  »  Microsoft Access

Re: Conect Mysql From Visual Basic Without odbc
Posted by: Saul Montalvo Perales
Date: August 04, 2004 12:40PM

estas usando un DSN o lo haces on un string de conexion directa a la base de datos ??

============================================
Private Sub ConectaMySQL()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset

Set conn = New ADODB.Connection
conn.Open "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;" & _
" DATABASE=test;" & _
" UID=root;" & _
" PWD=ceratti;" & _
" OPTION=35;"

Set rs = New ADODB.Recordset

sql = "show tables"
rs.Open sql, conn, adOpenDynamic, adLockOptimistic

While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
Debug.Print rs(i)
Next i
rs.MoveNext
Wend

rs.Close
conn.Close

Set rs = Nothing
Set conn = Nothing

End Sub
============================================

wRItinG4fU|\|=)

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Conect Mysql From Visual Basic Without odbc
5714
August 04, 2004 12:40PM
3472
December 14, 2004 05:38AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.