Forum > General

Problem with record numbers after order by index

(1/1)

johnmc:
I use the following code to give the current active record number in a table displayed in a TDBGrid

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---curRec := WineDBF.RecNo; 
When I change the displayed order of the data by ordering on an index the numbers of the records have changed. For instance starting with 414 records they will be numbered in sequence form 1 to 414, following the reordering the records will be 1 to 806 with gaps in the sequence.

Ordering is changed by:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---WineDBf.IndexName := 'idxByCountry'; 
Closing the application and restarting restores the correct record numbers.

John

johnmc:
It pays to read the manual. The use of indexes and filters affects the record count and record numbers returned by RecNo and RecordCount. I should have used PhysicalRecNo.

John

Handoko:
I ever had similar problem too.  :-[

Navigation

[0] Message Index

Go to full version