Firebird and AutoInc Value

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
HelgeLange
Posts: 17
Joined: Wed 13 Jun 2007 16:40
Location: Caracas

Firebird and AutoInc Value

Post by HelgeLange » Tue 22 Mar 2016 15:03

Hi there,

I'm struggling atm with an issue that I do have an auto-inc field and

El error aparece como "Refresh Failed. 0 records found"
Image

I searched all the forum and the problem appears to be that no change was found and that's a problem of the primary key.
So i configured the table with a primary, it looks like this now, but the error remains.
Image

The KeyField Id is configured as AutoInc and not required, as shown here :
Image

The database is firebird and the field has a trigger and a generator to create the autoinc value.
The dbmon tool shows queries where it looks for values with "where id is null", which makes no sense to me :p

If i open and close the table, everything works afterwards, but I guess that's not the general idea.
Any ideas what I'm doing wrong ? That problem is really annoying.

Thanks in advance for your help,
Helge

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Firebird and AutoInc Value

Post by ViktorV » Wed 23 Mar 2016 09:39

To return the value of an auto-incremental field generated on the server-side, you should set the TUniTable.DMLRefresh property to True. See more details about this property in the UniDAC help: https://www.devart.com/unidac/docs/?dev ... efresh.htm

HelgeLange
Posts: 17
Joined: Wed 13 Jun 2007 16:40
Location: Caracas

Re: Firebird and AutoInc Value

Post by HelgeLange » Wed 23 Mar 2016 11:29

Thanks, Victor. That works like a charm.. but not in a thousand years I would have guessed the answer. :mrgreen:

Helge

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Firebird and AutoInc Value

Post by ViktorV » Thu 24 Mar 2016 10:37

It is good to see that the issue has been solved. Feel free to contact us if you have any further questions about UniDAC.

Post Reply