Link to home
Create AccountLog in
Avatar of Jose Bredariol
Jose BredariolFlag for Brazil

asked on

The best way to open MYSQL tables in visual basic 2008

I´m trying to use the code bellow to open Mysql databe on my network. But its not working, What´s the problem ?: and this is the best way to open the databe on a network environment ?


      Dim strConnect As String
        Dim strProvider As String
        Dim usr_id As String      
        Dim pass As String        
        Dim mySqlIP As String    
        mySqlIP = "127.0.0.1"    


        usr_id = "root"  
        pass = "xxxxxxxxx"


        strConnect = "driver={MySQL ODBC 5.1 Driver};server=" & mySqlIP & ";uid=" & usr_id & ";pwd=" & pass & ";database=usuarios"

        adoDataConn = New ADODB.Connection

        adoDataConn.CursorLocation = adUseClient
        adoDataConn.Open(strConnect)

        rsMySQL = New ADODB.Recordset
        rsMySQL.CursorType = adOpenStatic
        rsMySQL.CursorLocation = adUseClient
        rsMySQL.LockType = adLockPessimistic
        rsMySQL.Source = "Select * From clients"
        rsMySQL.ActiveConnection = adoDataConn

        rsMySQL.Open()
Avatar of GMGenius
GMGenius
Flag of United Kingdom of Great Britain and Northern Ireland image

What OS are you running the application in?
are you sure the MySQL port is not blocked?
Avatar of Jose Bredariol

ASKER

It´s Visual Studio VB 2008. I´m not using .NET
I´m running it on my machine Windows Vista, I turned My firewall off.
@jbredariol

VS2008 is a VB.NET development environment.
It´s the same as VB.NET ?
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Sorry for that. So what´s the better way to access MYSQL for desktop application ?
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks all