FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ADO and decimal numbers
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
ADO and decimal numbers
Posted: Thu Jul 20, 2017 06:33 AM
hi
I have this code
Code (fw): Select all Collapse
@ 40, 10 GET o_get VAR m_get MEMO OF dialog SIZE 450, 200   PIXEL

oRs := FW_OpenRecordSet( oCn, m_Get, 1 )
...
@ 40,10 XBROWSE oBrw SIZE -10,-50 PIXEL CELL AUTOSORT;
RECORDSET oRs AUTOCOLS;
OF oDlg2

In m_get I put my Select... (Select * FROM...)
XBROWSE shows two decimal numbers but I want four decimal numbers
I can not to use PICTURE because SELECT change according to what I write in m_get

thank you
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: ADO and decimal numbers
Posted: Thu Jul 20, 2017 06:57 AM

Ciao ,
try

SET DECIMALS TO 4

Maurizio

www.nipeservice.com

Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: ADO and decimal numbers
Posted: Thu Jul 20, 2017 07:16 AM

Hi
ciao Maurizio

SET DECIMAL TO is inside at the top of .prg but not work with ADO

FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ADO and decimal numbers
Posted: Thu Jul 20, 2017 04:27 PM
Please make this modification in your xbrowse.prg:

Please locate the following lines in METHOD SetColFromADO(...)
Code (fw): Select all Collapse
   CASE ASCAN( { 4, 5, 6 }, nType ) > 0  // Single, Double, Currency
      cType         := 'N'
      nLen          := oField:Precision
      nDec          := 2


Please change the last line as:
Code (fw): Select all Collapse
       nDec  := Set( _SET_DECIMALS )


Now, in your code
SET DECIMALS TO 4 and run your program
Please let us know if this is working ok for you.
Regards



G. N. Rao.

Hyderabad, India
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: ADO and decimal numbers
Posted: Fri Jul 21, 2017 06:47 AM
hi Mr Rao thank you
I try this in xbrowse.prg
Code (fw): Select all Collapse
   CASE ASCAN( { 4, 5, 6 }, nType ) > 0  // Single, Double, Currency
      cType         := 'N'
      nLen          := oField:Precision
      nDec          := Set( _SET_DECIMALS )
*     nDec          := 2

and in my.prg
Code (fw): Select all Collapse
   SET DATE ITALIAN
    SET DELETED ON
    SET CENTURY ON
    SET CONFIRM ON
    SET DECIMALS TO 4
    SET FIXED ON


Inside file LINK1.RSP there is list of all .obj to compile and I put in xbrowse.obj

Code (fw): Select all Collapse
IF NOT ERRORLEVEL 1 IF EXIST *.obj c:\borland\bcc55\bin\ilink32 c0w32 @link1.rsp


Code (fw): Select all Collapse
...
prvmail.obj +
sendmail1.obj +
sendmail2.obj +
interact.obj +
xbrowse.obj +
funzio.obj, +
MYEXE.exe, + 
MYEXE.map, ...+


but in my browse I still get two decimals
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: ADO and decimal numbers
Posted: Mon Jul 24, 2017 07:37 AM
I Mr Rao
in xBrowse i changed oCol:nDataDec in SetColFromADO METHOD
Code (fw): Select all Collapse
if nDec != nil
*      oCol:nDataDec  := Min( nDec, 2 )
       oCol:nDataDec  :=  nDec 
endif


and now works
FiveWin for xHarbour 24.02 - Feb. 2024 - Embarcadero C++ 7.60 for Win32 Copyright (c) 1993-2023

FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)

Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: ADO and decimal numbers
Posted: Sun Jul 30, 2017 04:39 PM
damianodec wrote:I Mr Rao
in xBrowse i changed oCol:nDataDec in SetColFromADO METHOD
Code (fw): Select all Collapse
if nDec != nil
*      oCol:nDataDec  := Min( nDec, 2 )
       oCol:nDataDec  :=  nDec 
endif


and now works

This seems to be code from an older version.
Current version is just what you corrected.
So my first modification was working for me without problems
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion