Handle MySql BIT Data (Logical) in FiveWin/xHarbour

Handle MySql BIT Data (Logical) in FiveWin/xHarbour

Postby anserkk » Fri Mar 13, 2009 6:10 am

Hi,

I have a Table in MySql with data type as BIT. This is equivalent to a LOGICAL field in DBF.
BIT stores either 0 or 1 where in DBF we represent it as .F. or .T.

I am using ADO

When I retrieve Data from the MySql Table on a RecordSet, FiveWin/Harbour is displaying/processing all BIT Data as .T. irrespective of its real 0 and 1 's (.F. and .T.)

I have checked the data on the Table using Toad for MySQL and found that the recordset is showing the data exactly as required.

Has anybody encountered this problem ? Any idea how this can be handled so that the data is converted to either .T. or .F.
I tried to display the recordset data on a xBrwse too, but all the BIT data's are shown as .T.

Is there anything that I have to take care while handling BIT Data using FiveWin and ADO

Regards

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

Re: Handle MySql BIT Data (Logical) in FiveWin/xHarbour

Postby anserkk » Sat Mar 14, 2009 5:35 am

Hi,

First of all let me thank Daniel,Armando and William.
viewtopic.php?f=6&t=14911

I am facing the following problem as explained below.

When I insert data into the Table I have used numeric value either 0 or 1 to store data on a BIT type field (ACTIVE is a BIT Type Field). That's the way it is supposed to be. BIT field can contain only either 0 or 1
ie
Code: Select all  Expand view
cCmdSql := "INSERT INTO TEST (CODE,NAME,ACTIVE) VALUES('001','George',0);"


I am using MySQL ODBC Driver 5.1

After the data is Inserted into the table and when I check the Table data using Toad for MySQL the data is perfect and it is showing check_on and check_off for BIT type Data.

But when I read/retrieve the same data in recordset using ADO from FiveWin, the BIT data is always .T. irrespective of the actual value 0's and 1's

From Armando's and Daniels test's, I understand that the above described problem is caused due to a bug in the latest MySQL ODBC Driver ver 5.1

Moving to ODBC ver 3.5 should solve the problem. It is really sad to move from a latest version to an older version, but no other way.

Has anybody here faced similiar problem in any other programming languages For eg.VB/Delphi and MySQL with ODBC ver 5.1 using ADO?

Once again I thank Daniel,Armando and William.

Thanks

Anser
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: Google [Bot] and 91 guests