Cannot connect to MySQL using VB.NET 1.1
am 23.02.2006 04:28:10 von zMisc
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
Re: Cannot connect to MySQL using VB.NET 1.1
am 23.02.2006 05:23:19 von Michael Austin
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/en/odbc-net-op-vb-cp.htm l 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
:)
Re: Cannot connect to MySQL using VB.NET 1.1
am 23.02.2006 06:41:50 von zMisc
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" wrote in message
news:XMaLf.34128$Jd.21127@newssvr25.news.prodigy.net...
> 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/en/odbc-net-op-vb-cp.htm l 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
> :)