Print Thread
RecordCount is not up to date after deleting a record
#779 08/18/00 10:06 PM
Joined: Jun 2000
Posts: 8
Bordeaux, France
S
SteLal Offline OP
Member
OP Offline
Member
S
Joined: Jun 2000
Posts: 8
Bordeaux, France
Windows NT / Oracle 8i / BCB5 / DOA 3.3.2

RecordCount is not up to date after deleting a record:
I have a OracleDataset based on a "normal" table or on a temporary table.
By example, it contains 8 records.
RecordCount is 8.
When I delete one record (ore more), record count stills says 8.

Via the debugger window, I've also noticed that the private member Records->RecordCount() contains the correct number...

Thanks for help...

------------------
St


St
Re: RecordCount is not up to date after deleting a record
#780 08/19/00 03:34 PM
Joined: Aug 1999
Posts: 22,206
Member
Offline
Member
Joined: Aug 1999
Posts: 22,206
I assume you have set CountAllRecords to True (in other words, you need to know the total number of records in the result set before they are actually fetched). In this case the RecordCount property does indeed not include inserted or deleted records. We'll try to fix this in the 3.4 release.

If CountAllRecords is False, the RecordCount property will reflect the number of records that are fetched. In this situation the inserted and deleted records are included as well. This may be a possible work around.

------------------
Marco Kalter
Allround Automations


Marco Kalter
Allround Automations
Re: RecordCount is not up to date after deleting a record
#781 08/21/00 02:09 PM
Joined: Jun 2000
Posts: 8
Bordeaux, France
S
SteLal Offline OP
Member
OP Offline
Member
S
Joined: Jun 2000
Posts: 8
Bordeaux, France
Thanks Marco !

To always have RecordCount up to date,
this solution works fine:

- Set CountAllRecords to TRUE
- Open the DataSet.
- Set CountAllRecords to FALSE, assuming correct recordcount when adding/removing records.

- Don't forget to Set CountAllRecords to TRUE before each re-opening, then resetting it to FALSE just after.


------------------
St


St

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.021s Queries: 14 (0.006s) Memory: 2.5021 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-01 04:56:00 UTC
Valid HTML 5 and Valid CSS