Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DBGrid with duplicated rows

206 views
Skip to first unread message

Eduardo Pereira

unread,
Mar 1, 1999, 3:00:00 AM3/1/99
to
After upgrade a database from Paradox to Interbase, the data displayed in
dbgrids started to have problems.

It happens with dbgrids attached to ttables components. When [Crtl]+[End] is
pressed to go to the end of the table, some duplicated rows appears, covering
other rows with data. The duplication occurs when the table is using a
secondary index and there are records with the same index key value. The
first row of an index key value is duplicated over the last row with the same
index key value.

In the example below, the table is indexed by the field 'Date'. The
duplication occurs with the record ID=346 that covers the record ID=348. Both
records have the same index key value, that is, Date=02/07/99.

Normal display Duplicated display

ID Date Name | ID Date Name
|
345 02/05/99 AAA | 345 02/05/99 AAA
346 02/07/99 BBB | 346 02/07/99 BBB
347 02/07/99 CCC | 347 02/07/99 CCC
348 02/07/99 DDD | 346 02/07/99 BBB <-- duplicate row
349 02/10/99 EEE | 349 02/10/99 EEE

Some further observations:

-When the grid is scrolled with PageDown or arrow down, the grid display is
ok. -With the grid showing duplicated records, when a new row is inserted
(but not posted), the duplicated rows disappear and the grid displays
normal. -Using the SQL Monitor, the records sent by the server are not
duplicated. -I tested this with Delphi 2 and Delphi 4 and the same behavior
is observed in both.

There is another case that duplicated rows appears: when a new record is
inserted in the dDBGrid, it is duplicated. One of the copies cannot be edited
(the message "Couldn't perform the edit because another user changed the
record" is shown). When any other row is edited and posted, the fake copy
disappear. It seems to be related with the trigger used for generate the
unique ID. When the trigger is inactive, the insertion goes fine.

In the Borland's support page, the indicated solution for the duplicated rows
in dbgrids is to change the LANGUAGE DRIVER setting, in the BDE's
configuration. I have tried a sort of combinations between language drivers
in the BDE and character sets in the Interbase database and none of them
seems to work.

Thanks in advance for any help.


Eduardo Pereira

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Robert Cerny

unread,
Mar 1, 1999, 3:00:00 AM3/1/99
to
Yes, I noticed these anomalties too. Seems it has something to do with
bookmarks - that different handling of bookmarks with Tquery cursors than
with Ttable cursors.
However, it may be normal behaviour with non-unique indexes.

Switch to TQuery and see if it happens again.

--
----------------------
Regards
Robert Cerny
Remove both qwe when replying
email: robert.q...@neosys.xrs.qwe.si

No questions via email, unless explicitly invited.
Eduardo Pereira wrote in message <7beplq$r9$1...@nnrp1.dejanews.com>...


>After upgrade a database from Paradox to Interbase, the data displayed in
>dbgrids started to have problems.
>
>It happens with dbgrids attached to ttables components. When [Crtl]+[End]
is
>pressed to go to the end of the table, some duplicated rows appears,
covering
>other rows with data. The duplication occurs when the table is using a
>secondary index and there are records with the same index key value. The
>first row of an index key value is duplicated over the last row with the
same
>index key value.

>[snip]

0 new messages