ADO and decimal numbers

ADO and decimal numbers

Postby damianodec » Thu Jul 20, 2017 6:33 am

hi
I have this code
Code: Select all  Expand view  RUN


@ 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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: ADO and decimal numbers

Postby Maurizio » Thu Jul 20, 2017 6:57 am

Ciao ,
try

SET DECIMALS TO 4

Maurizio
www.nipeservice.com
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: ADO and decimal numbers

Postby damianodec » Thu Jul 20, 2017 7:16 am

Hi
ciao Maurizio

SET DECIMAL TO is inside at the top of .prg but not work with ADO
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: ADO and decimal numbers

Postby nageswaragunupudi » Thu Jul 20, 2017 4:27 pm

Please make this modification in your xbrowse.prg:

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


Please change the last line as:
Code: Select all  Expand view  RUN

       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
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: ADO and decimal numbers

Postby damianodec » Fri Jul 21, 2017 6:47 am

hi Mr Rao thank you
I try this in xbrowse.prg
Code: Select all  Expand view  RUN
  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: Select all  Expand view  RUN
  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: Select all  Expand view  RUN
IF NOT ERRORLEVEL 1 IF EXIST *.obj c:\borland\bcc55\bin\ilink32 c0w32 @link1.rsp


Code: Select all  Expand view  RUN
...
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 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: ADO and decimal numbers

Postby damianodec » Mon Jul 24, 2017 7:37 am

I Mr Rao
in xBrowse i changed oCol:nDataDec in SetColFromADO METHOD
Code: Select all  Expand view  RUN

if nDec != nil
*      oCol:nDataDec  := Min( nDec, 2 )
       oCol:nDataDec  :=  nDec
endif


and now works
FiveWin for xHarbour 17.09 - Sep. 2017 - Embarcadero C++ 7.00 for Win32
FWH 64 for Harbour 19.06 (MSVC++) Jun. 2019 - Harbour 3.2.0dev (r1904111533)
Visual Studio 2019 - Pelles C V.8.00.60 (Win64)
User avatar
damianodec
 
Posts: 419
Joined: Wed Jun 06, 2007 2:58 pm
Location: Italia

Re: ADO and decimal numbers

Postby nageswaragunupudi » Sun Jul 30, 2017 4:39 pm

damianodec wrote:I Mr Rao
in xBrowse i changed oCol:nDataDec in SetColFromADO METHOD
Code: Select all  Expand view  RUN

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
User avatar
nageswaragunupudi
 
Posts: 10663
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 47 guests