Hello,
Im trying to connect to a MySQL DB on my home network (testing purposes) using the following VB.NET code;
When i execute the code i dont get any error messages from VS such as
I have set up MySQL to allow Remote connections on port 3306 for the username and password (above).
I have installed MySQL P which actually does allow me to to get a connection to the DB as it brings back the tables in the DB.
see attached image
However through VS i am unable to display the table data. i get the following error message...
Im confused as to whether i have a working connection or not. So ive included a DROP TABLE command to parse to the DB. However the table in question doesnt get dropped. Ive also tried INSERT statements etc but none of which have worked.
So i am unsure whether it is the Connection or SQL Command code that is wrong.
I am using WAMP Server 2.0 with Apache 1.3.39 and MySQL 5.0.45.
If any one has some ideas please help!!!
Thanks in advance
Sy
Im trying to connect to a MySQL DB on my home network (testing purposes) using the following VB.NET code;
Code:
Imports System.Data.OleDb
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim SQLConnection As OleDbConnection
Dim SQLInsertCMD As OleDbCommand
Dim sConnString As String = _
"Provider=OleMySql.MySqlSource.1;" & _
"Data Source=192.168.1.121, 3306;" & _
"Initial Catalog=airproductsipdb;" & _
"User Id=[B]USERNAME[/B];" & _
"Password=[B]PASSWORD[/B]"
SQLConnection = New OleDb.OleDbConnection(sConnString)
SQLConnection.Open()
SQLInsertCMD = New OleDb.OleDbCommand("DROP TABLE table ;")
End Sub
[2003]: Can't connect to MySQL server on '192.168.1.122 3306' (10060)
Say if the IP address is different (.122 instead of .121)
I have set up MySQL to allow Remote connections on port 3306 for the username and password (above).
I have installed MySQL P which actually does allow me to to get a connection to the DB as it brings back the tables in the DB.
see attached image
However through VS i am unable to display the table data. i get the following error message...
Code:
SQL Execution Error Executed SQl statement: SELECT site_id, Gateway_IP, Sitename, SubentAddress, SubnetMask, BroadcastAddress FROM sitename Error Source: System.Data Error Message: MySQL OLE DB Provider has not been activated
So i am unsure whether it is the Connection or SQL Command code that is wrong.
I am using WAMP Server 2.0 with Apache 1.3.39 and MySQL 5.0.45.
If any one has some ideas please help!!!
Thanks in advance
Sy
Comment