Problem with step by step insert/edit with Version 3 /FB 2.1

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
barnie00
Posts: 11
Joined: Mon 24 Sep 2007 20:37

Problem with step by step insert/edit with Version 3 /FB 2.1

Post by barnie00 » Mon 27 Jul 2009 00:39

Hello!

For some reason I have to to an insert and update process step by step.

Example:

1. Insert Field_1 (with ID filled by a db trigger)
2. Update Field_2, Field_3
2. Update Field_4, Field_5,
3. Update Field_6, ...

The problem is that the ID is set by a db trigger during insert, so I do not have it for the 2.,3.,... step.

When I have filled all fields with this procedure only the ID field is really filled. All other fields are empty when I reload the record.
There is no exception or error message during the update steps so they should write to the right record. But later all fields are empty
The only way i was able to find to solve the problem is send the refresh command after inserting the value in Field_1.
But than another record is the current on, so i have to activate the correct record before i can start the update sequence.

What can I do?
Thanks

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 03 Aug 2009 07:56

Set the DMLRefresh property of TIBCQuery to True. In this case ID field will be filled after insert.

Post Reply