By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,652 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,652 IT Pros & Developers. It's quick & easy.

Cannot connect to MySQL using VB.NET 1.1

P: n/a
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database.

I've done the following:

1) Create a DSN for MyODBC.
2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data
Source=test; UID=test; PWD=pwd; OPTION=3
When I run my app, I get this error: An OLE DB Provider was not specified in
the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I tried changing the connection string to Provider=MySQL ODBC 3.51 Driver;
Server=localhost; Data Source=test; UID=test; PWD=pwd; OPTION=3 (Instead of
Driver, I change it to Provider - most of the examples I found on the net
including those from MySQL AB uses Driver).

Now I get this error: The 'MySQL ODBC 3.51 Driver' provider is not
registered on the local machine.

Can someone please help?

Tks
Young

Feb 23 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
zMisc wrote:
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database.

I've done the following:

1) Create a DSN for MyODBC.
2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data
Source=test; UID=test; PWD=pwd; OPTION=3
When I run my app, I get this error: An OLE DB Provider was not specified in
the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I tried changing the connection string to Provider=MySQL ODBC 3.51 Driver;
Server=localhost; Data Source=test; UID=test; PWD=pwd; OPTION=3 (Instead of
Driver, I change it to Provider - most of the examples I found on the net
including those from MySQL AB uses Driver).

Now I get this error: The 'MySQL ODBC 3.51 Driver' provider is not
registered on the local machine.

Can someone please help?

Tks
Young

http://dev.mysql.com/doc/refman/5.0/...-op-vb-cp.html has an excellent
example of how to do this:

'MyODBC 3.51 connection string
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};" & _
"SERVER=localhost;" & _
"DATABASE=test;" & _
"UID=venu;" & _
"PASSWORD=venu;" & _
"OPTION=3;"

'Connection
Dim MyConnection As New OdbcConnection(MyConString)
MyConnection.Open()

Note the quotes/braces around the DRIVER section

--
Michael Austin.
DBA Consultant
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)
Feb 23 '06 #2

P: n/a
I just realised I am trying to use OLE DB to connect to MySQL.

Is it possible to connect to MySQL OLE DB? Where can I download MyOLEDB?

Tks

"Michael Austin" <ma*****@firstdbasource.com> wrote in message
news:XM******************@newssvr25.news.prodigy.n et...
zMisc wrote:
I am using VB.NET 1.1 and cannot connect to a MySQL (v5) database.

I've done the following:

1) Create a DSN for MyODBC.
2) Connect using: Driver=MySQL ODBC 3.51 Driver; Server=localhost; Data
Source=test; UID=test; PWD=pwd; OPTION=3
When I run my app, I get this error: An OLE DB Provider was not specified
in the ConnectionString. An example would be, 'Provider=SQLOLEDB;'.

I tried changing the connection string to Provider=MySQL ODBC 3.51
Driver; Server=localhost; Data Source=test; UID=test; PWD=pwd; OPTION=3
(Instead of Driver, I change it to Provider - most of the examples I
found on the net including those from MySQL AB uses Driver).

Now I get this error: The 'MySQL ODBC 3.51 Driver' provider is not
registered on the local machine.

Can someone please help?

Tks
Young

http://dev.mysql.com/doc/refman/5.0/...-op-vb-cp.html has an
excellent example of how to do this:

'MyODBC 3.51 connection string
Dim MyConString As String = "DRIVER={MySQL ODBC 3.51 Driver};" &
_
"SERVER=localhost;" & _
"DATABASE=test;" & _
"UID=venu;" & _
"PASSWORD=venu;" & _
"OPTION=3;"

'Connection
Dim MyConnection As New OdbcConnection(MyConString)
MyConnection.Open()

Note the quotes/braces around the DRIVER section

--
Michael Austin.
DBA Consultant
Donations welcomed. Http://www.firstdbasource.com/donations.html
:)

Feb 23 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.