Re:TDBGrid doing weird things when scrolling
I don't think so. If I close the application and restart it the table looks
fine. If I scroll using the navigator 1 record at a time it is fine. When I
scroll down 47,000 records using the scroll bar it is fine but if I scroll
5-10 thousand more than that the data gets mixed up from field to field and
my date field ends up with values of 00/00/0000 when they should be blank
etc. I did find a way that seems to get around this issue. Even though I
have built a primary index and set the indexname := ''; which should default
back to the primary index I added this code to the table afterscroll event:
if ViewDataTable.State = dsBrowse then
begin
ViewDataTable.Refresh;
//secondary index built with no options specified
ViewDataTable.IndexName := 'Item Number';
end;
When I did this the first time you scroll down more than 50,000 records the
data flickers like it may be messed up again but then it is fine. I can then
scroll up and down 3 to 4 hundred thousand records at a time and it is fine.
It is really wierd and I have tested it multiple times and without fail if I
do not have the afterscroll event set it will mess it up and when I have the
afterscroll event logic it is fine? I also found that instead of using the
afterscroll event that if I set a secondary index active before I scroll it
is also fine. I know that my primary index is working because before I do a
FindKey I set the indexname := '' and FindKey works great........
"Bill Todd (TeamB)" <billtodd...@nospam.qwest.net> wrote in message
news:3b029413_1@dnews...
Quote
> It is possible that the table is corrupt. You might try rebuilding it with
> the table repair utility at www.rksolution.cz and see if that helps.
> --
> Bill