change value recordset

change value recordset

Postby damianodec » Mon Jul 29, 2019 9:25 am

hi,
I would like to change a recordset value:
Code: Select all  Expand view

...
oResi := FW_OpenRecordSet( oCn, tuple, 1 )
...
oResi:Fields("TOTQTA"):value = 10180,00
...
 


I know that oResi:Fields("TOTQTA"):value = 10180,00 is wrong but is there any way to change it?

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: change value recordset

Postby damianodec » Wed Jul 31, 2019 6:12 am

is it impossible?
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: change value recordset

Postby Enrico Maria Giordano » Wed Jul 31, 2019 9:11 am

It looks correct to me. But change comma with dot:

Code: Select all  Expand view
oResi:Fields("TOTQTA"):value = 10180.00


And commit the change with

Code: Select all  Expand view
oResi:Update()


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: change value recordset

Postby damianodec » Fri Aug 02, 2019 6:15 am

hi Enrico, doesn't work.

in line 588:
Code: Select all  Expand view
oResi:Fields("TOTQTA"):value = nTotaleVenduti - nTotaleResi


I get this:
Time from start: 0 hours 0 mins 23 secs
Error occurred at: 01-08-2019, 15:26:37
Error description: Error ADODB.RecordSet:FIELDS/0 S_OK: _VALUE
Args:
[ 1] = N 542845.0000

Stack Calls
===========
Called from: => TOLEAUTO:_VALUE( 0 )
Called from: gesres.prg => GESRES11( 588 )
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: change value recordset

Postby Enrico Maria Giordano » Fri Aug 02, 2019 7:34 am

What is the field type of TOTQTA?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: change value recordset

Postby damianodec » Fri Aug 02, 2019 8:52 am

decimal(12, 3)
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: change value recordset

Postby Enrico Maria Giordano » Fri Aug 02, 2019 9:01 am

You are assigning

542845.0000

Try with

542845.000

or change the field type to double or currency (or something similar that is supported by your database engine).

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8712
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 99 guests