Link to home
Start Free TrialLog in
Avatar of bhermer
bhermer

asked on

MySQL connection failing in Vista & VS2005

Hi,

I have been using VS2005 under XP pro fine.

I have just upgraded to Vista (downgraded maybe ;))  and I have opened one of my 'Working' websites that uses MySQL, using reference to the MySQL 1.08 ASP Connector.

I get the following error (btw I can connect to the DB fine through my DBtools DB manager software and the command promt so I know the DB is fine)

Unable to connect to any of the specified MySQL hosts

An example of the code is the following:

Imports MySql.Data.MySqlClient

 Public Shared Function CreateDataSet(ByVal SQL As String)
        Dim myConnection As New MySqlConnection("server=localhost; user id=root; password=******; database=aa; pooling=false;")
        myConnection.Open()
        Dim myCommand As New MySqlCommand(SQL, myConnection)
        Dim myAdapter As New MySqlDataAdapter(myCommand)
        Dim ds As New DataSet()
        myAdapter.Fill(ds)
        Return ds
    End Function

Thanks
Avatar of surajguptha
surajguptha
Flag of United States of America image

Are you able to connect to MYSQL using any MYSQL client?
Avatar of bhermer
bhermer

ASKER

I can connect to the DB fine through my DBtools DB manager software and the command promt so I know the DB is fine
Avatar of bhermer

ASKER

I can also connect using VB6 and ODBC fine, this must be a connector problem, I am just not sure what to do about it as it did work fine under XP
Avatar of bhermer

ASKER

ok, sorry to be a pain here, but I have found the solution, I have upgraded the connector to the latest version from here
http://dev.mysql.com/downloads/connector/net/5.1.html

cirtainly something I should have tried first.  Sorry to have wasted your time.
Try ing to understand -> VB6 and Tools from the same Vista Machine is able to talk to the Database however when you are trying to connect to MYSQL through your .net code, it fails?
Avatar of bhermer

ASKER

yes, but VB6 uses an ODBC connector, and NET uses a .NET connector, different bits of software. I found an article on MySQL's site that was unrelated to this problem, but was about problems with Vista in general, it suggested trying this new connector, this has fixed the problem.
oh cool. Best of Luck with Vista. Its funny because we pay for Vista to get into more trouble :P
Avatar of Deepak Vasudevan
I think the ODBC Connector should also be Vista-compliant right? Is it available yet?
Avatar of bhermer

ASKER

hi,  my comment:

ok, sorry to be a pain here, but I have found the solution, I have upgraded the connector to the latest version from here
http://dev.mysql.com/downloads/connector/net/5.1.html

cirtainly something I should have tried first.  Sorry to have wasted your time.

was the solution, any chance you can mark that as the answer for anyone else needing the info?
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial