Jose Bredariol
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(strConnec t)
rsMySQL = New ADODB.Recordset
rsMySQL.CursorType = adOpenStatic
rsMySQL.CursorLocation = adUseClient
rsMySQL.LockType = adLockPessimistic
rsMySQL.Source = "Select * From clients"
rsMySQL.ActiveConnection = adoDataConn
rsMySQL.Open()
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
adoDataConn.Open(strConnec
rsMySQL = New ADODB.Recordset
rsMySQL.CursorType = adOpenStatic
rsMySQL.CursorLocation = adUseClient
rsMySQL.LockType = adLockPessimistic
rsMySQL.Source = "Select * From clients"
rsMySQL.ActiveConnection = adoDataConn
rsMySQL.Open()
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.
I´m running it on my machine Windows Vista, I turned My firewall off.
@jbredariol
VS2008 is a VB.NET development environment.
VS2008 is a VB.NET development environment.
ASKER
It´s the same as VB.NET ?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Sorry for that. So what´s the better way to access MYSQL for desktop application ?
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thanks all
are you sure the MySQL port is not blocked?