Erroneous conversion type ADO->boolean to xBrowse->logical
Erroneous conversion type ADO->boolean to xBrowse->logical
Dear Antonio,
I found a erroneous conversion type in ADO->boolean to xBrowse->logical
ADO returns for xHarbour, for boolean fields, a numeric type. With this, I can't use the setCheck() method on xBrowse.
Please, it's possible for you to solve this problem? I can do it by myself?
Thank you very much!
I found a erroneous conversion type in ADO->boolean to xBrowse->logical
ADO returns for xHarbour, for boolean fields, a numeric type. With this, I can't use the setCheck() method on xBrowse.
Please, it's possible for you to solve this problem? I can do it by myself?
Thank you very much!
Last edited by JC on Wed Feb 04, 2009 5:59 pm, edited 2 times in total.
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous type in ADO->boolean to xBrowse->logical
A little sample just for understanding
Into my object RecordSet... in this construction, I use the boolean type in :fields:append( "Active", adBoolean,, adFldUpdatable )... but, when the recordset is filled by any query into MySQL, the boolean field is interpreted like adTinyInt and this return 0 or 1 (not .T. or .F.)
Into my object xBrowse
Into my object RecordSet... in this construction, I use the boolean type in :fields:append( "Active", adBoolean,, adFldUpdatable )... but, when the recordset is filled by any query into MySQL, the boolean field is interpreted like adTinyInt and this return 0 or 1 (not .T. or .F.)
Code: Select all
WITH OBJECT oRecordSet
:fields:append( "Code", adInteger, 5, adFldUpdatable )
:fields:append( "name", adVarChar, 30, adFldUpdatable )
:fields:append( "Active", adBoolean,, adFldUpdatable )
:fields:append( "Reg Date", adDate,, adFldUpdatable )
TRY
:open()
:addNew()
:fields( "Code" ):value := 1
:fields( "name" ):value := "JÚLIO CÉSAR M. FERREIRA"
:fields( "Active" ):value := .T.
:fields( "Reg Date" ):value := date()
:addNew()
:fields( "Code" ):value := 2
:fields( "name" ):value := "NEW USER FOR TESTS"
:fields( "Active" ):value := .F.
:fields( "Reg Date" ):value := date()
:addNew()
:fields( "Code" ):value := 3
:fields( "name" ):value := "ANOTHER NEW USER FOR TESTS"
:fields( "Active" ):value := .F.
:fields( "Reg Date" ):value := date()
:addNew()
:fields( "Code" ):value := 4
:fields( "name" ):value := "MORE ONE USER"
:fields( "Active" ):value := .T.
:fields( "Reg Date" ):value := date()
:moveFirst()
END
Code: Select all
WITH OBJECT oBrw
:bClrRowFocus := {|| { CLR_BLACK, nrgb( 228, 232, 224 ) } }
:bClrSel := {|| { , nrgb( 228, 232, 224 ) } }
:nMarqueeStyle := 4
:nRowDividerStyle := 4
:nColDividerStyle := 4
:lColDividerComplete := .F.
:nStretchCol := STRETCHCOL_WIDEST
:createFromCode()
//:bLDblClick( {|| oRecordSet:fields( "Active" ):value := !oRecordSet:fields( "Active" ):value, oBrw:refresh() } )
WITH OBJECT :aCols[3]
:setCheck( { "GREEN", "RED" }, {|| msgInfo( oRecordSet:fields( "Active" ):value ) } )
:setCheck( { "GREEN", "RED" }, {|o, v| ( oRecordSet:fields( "Active" ):value := v, msgInfo( oRecordSet:fields( "Active" ):value ) ) } )
:bStrData := {|| If( oRecordSet:fields( "Active" ):value, "Yes", "No" ) }
:nDataStrAlign := AL_RIGHT
END
END
Last edited by JC on Wed Feb 04, 2009 5:58 pm, edited 1 time in total.
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Sorry,
Still have error
Still have error
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Please, someone knows?
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Better starting with a reduced and self-contained sample of the problem.
EMG
EMG
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
I will provider it now!Enrico Maria Giordano wrote:Better starting with a reduced and self-contained sample of the problem.
EMG
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Dear friends,
Please, somebody can help me with this?
Many weeks with this error...
Please, somebody can help me with this?
Many weeks with this error...
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Julio:
I use the traditional code (I do not use PPO) and I have no problems, here is a sample.
This is a field and it's propierties
Then I move all the fields from the record set to variables
And if I show the oPro:CAN variable I get the .T. or .F. value
Regards
I use the traditional code (I do not use PPO) and I have no problems, here is a sample.
This is a field and it's propierties
Code: Select all
"PRO_CAN BIT NOT NULL COMMENT 'Cancelado ?'," +;
Code: Select all
oPro:CAN := oRsPro:Fields("PRO_CAN"):Value
Code: Select all
MsgInfo(oPro:CAN)
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
This value field oRsPro:Fields("PRO_CAN"):Value is from the MySQL boolean type?
Into MySQL, the boolean type is tinyint (a numeric value, it can be 0 or 1 ) and when it's access via xHarbour... it's returns a numeric type, not a logical type.
Into MySQL, the boolean type is tinyint (a numeric value, it can be 0 or 1 ) and when it's access via xHarbour... it's returns a numeric type, not a logical type.
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Julio:
No, is BIT type, this is the definition
"PRO_CAN BIT NOT NULL COMMENT 'Cancelado ?'," +;
Regards
No, is BIT type, this is the definition
"PRO_CAN BIT NOT NULL COMMENT 'Cancelado ?'," +;
Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
In MySQL definition:
If you put in this format, the MySQL convert to tinyint again
When we get this value from ADO, it's is numeric!!
Code: Select all
CREATE TABLE test(
active_register tinyint(1) NOT NULL default 0
);
Code: Select all
CREATE TABLE test(
active_register boolean NOT NULL default 0
);
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Julio:
Please try this way
Regards
Please try this way
Code: Select all
CREATE TABLE test(
active_register bit NOT NULL default 0 // .F.
);
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Dear Armando,Armando wrote:Julio:
Please try this way
RegardsCode: Select all
CREATE TABLE test( active_register bit NOT NULL default 0 // .F. );
This is really very beautiful!
Now it's work perfectly!!
The field must be BIT and no boolean(tinyint)
Thank you for your attention with my problem!
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Re: Erroneous conversion type ADO->boolean to xBrowse->logical
Armando,
I have another doubt!
With fields type timestamp, the xHarbour returns DATE type field...
I resolve this using like this:
Exists another way to do?
I have another doubt!
With fields type timestamp, the xHarbour returns DATE type field...
Code: Select all
CREATE TABLE test(
date_recognize timestamp not null default current_timestamp
);
Code: Select all
SELECT date_recognize FROM test;
R=2009-12-24
SELECT CAST( date_recognize AS CHARACTER ) as date_recognize FROM test;
R='2009-12-24 12:12:41'
Peace and lighting!
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Júlio César M. Ferreira
FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9