Creating MySQL 5.2a DSN from VB.Net 2010
Posted by: rasinc rasinc
Date: June 10, 2014 03:16PM

I have been working with the MySQL ODBC 3.51 Driver for several years and I can dynamically create a User DSN for any database I am using.

However, I have been asked to switch over to the MySQL ODBC 5.2a Driver. I have changed my code to reflect the change in driver and while it does create a DSN, it does not create it for the proper port or server. I cannot figure out what I am doing wrong.

I am using the following code snippet

----------------------------------
Attributes = "DSN=" & sDSN & vbNullChar _
& "SERVER=" & strHost & vbNullChar _
& "Database=mydb" & vbNullChar _
& "Port=" & strPort & vbNullChar

intRet = SQLConfigDataSource(vbAPINull, lAction, sDriver, Attributes)
----------------------------------

which works when using the 3.51 driver but only gives me port 3306 with the 5.2a driver, even though all other parameters are the same except the driver.

Is there a change to the syntax in the 5.2a driver that I cannot figure out?

I've read this article

http://downloads.mysql.com/docs/connector-odbc-en.pdf

but it only refers to creating the DSN's manually.

Any help is appreciated. TIA, rasinc

Options: ReplyQuote


Subject
Written By
Posted
Creating MySQL 5.2a DSN from VB.Net 2010
June 10, 2014 03:16PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.