AUTOINCREMENT doesn't work

Discussion of open issues, suggestions and bugs regarding LiteDAC (SQLite Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 14
Joined: Thu 29 Aug 2013 06:57

AUTOINCREMENT doesn't work

Post by Schlueter » Wed 08 Oct 2014 10:52


I've updated to Version 2.4.11 from 2.3.9 and now the AUTOINCREMENT on fields doesn't work any more.

There is a table with a primary key of type INTEGER. If I didn't filled the key-field on INSERT, it was automatically set by an AUTOINCREMENT value. But now with new version on POST I get an error message that the field must have a value.

I should mention that I'm using a TClientDataset for the INSERT which is linked to the TLiteQuery by a TDataSetProvider.

Best regards

Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: AUTOINCREMENT doesn't work

Post by AlexP » Thu 09 Oct 2014 09:38


This error is due to that the NOT NULL attribute is set in the DDL definition of your auto-incremental field. In the new version, we process this attribute correctly and set the Required property to True for such fields. To solve the problem, you should remove the NOT NULL attribute from the DDL (this attribute is not need for auto-incremental fields), or set the UniQuery1.Options.RequiredFields property to false.

Post Reply