MySQL ADO Error with ODBC Driver 5.1

MySQL ADO Error with ODBC Driver 5.1

Postby anserkk » Fri Jan 09, 2009 5:20 am

Hi,

I have developed an application with the following MySQL Query. I am using ADO

Code: Select all  Expand view
Select UserName,User_Id, Active,Password,
    case
         When Active = 'T' Then 'Yes'
         else 'No'
    end as Enabled
from users where Branch_ID=1


This was working fine in my application with MySQL ODBC Driver 3.51

Today I uninstalled ODBC Driver 3.51 and installed the new ODBC Driver 5.1
Unfortunately after installing the new Driver 5.1 I get the follwoing error message when I run my application

"Data provider or other service returned an E_FAIL status"

This error is not there If I change the ODBC Driver to 3.51

I tried this in different PC's but it seems that the problem exists only when ODBC Driver 5.1

Another amazing fact is that only this particular query is failing. Other queries from the same table is working fine in both ver 3.51 and 5.1.

The only change in the code is the connection string. The following line in the connections string

Code: Select all  Expand view
"Driver={MySQL ODBC 3.51 Driver}"


was replaced with

Code: Select all  Expand view
"Driver={MySQL ODBC 5.1 Driver}"


I tried to run this query from Toad for MySql and is working fine.

If I change the sql statement from

Code: Select all  Expand view
Select UserName,User_Id, Active,Password,
case
When Active = 'T' Then 'Yes'
else 'No' "
end as Enabled
from users where Branch_ID=1


To

Code: Select all  Expand view
Select UserName,User_Id,Active,Password from users where Branch_ID=1


Then there is no problem and everything works fine

The Column Active is of Type Enum('T','F') with Default Value 'T'


Has anybody else here experienced this error.

Any hint ?

Regards
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests