FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour change value recordset
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
change value recordset
Posted: Mon Jul 29, 2019 09:25 AM
hi,
I would like to change a recordset value:
Code (fw): Select all Collapse
...
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 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: change value recordset
Posted: Wed Jul 31, 2019 06:12 AM

is it impossible?

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: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: change value recordset
Posted: Wed Jul 31, 2019 09:11 AM
It looks correct to me. But change comma with dot:

Code (fw): Select all Collapse
oResi:Fields("TOTQTA"):value = 10180.00


And commit the change with

Code (fw): Select all Collapse
oResi:Update()


EMG
Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: change value recordset
Posted: Fri Aug 02, 2019 06:15 AM
hi Enrico, doesn't work.

in line 588:
Code (fw): Select all Collapse
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 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: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: change value recordset
Posted: Fri Aug 02, 2019 07:34 AM

What is the field type of TOTQTA?

EMG

Posts: 434
Joined: Wed Jun 06, 2007 02:58 PM
Re: change value recordset
Posted: Fri Aug 02, 2019 08:52 AM

decimal(12, 3)

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: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: change value recordset
Posted: Fri Aug 02, 2019 09: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

Continue the discussion