I am migrating our Delphi XE2 application from MSSQL (using ADO components), to PostgreSQL, using UniDAC.
In database, there are some serial
type fields (autoincrements). When I append record, I not put any data to this autoincrement field. Formely, with MSSQL/ADO it works automatically, but now I have an exception.
The code:
aqrMsgs.Append;
aqrMsgsUser_From.AsInteger := UserId;
aqrMsgsUser_To.AsString := UserIds[I];
aqrMsgsSubject.AsString := Trim (edtSubject.Text);
aqrMsgsContents.AsString := mmoContents.Text;
aqrMsgsIsDone.AsBoolean := False;
aqrMsgs.Post;
And the exception is:
Field 'id' is TIntegerField
, not TAutoIncrementField.
By the way, if I using DBGrid edit ability (exactly, I using ExpressQuantumGrid), to append records to another table with the same structure, everything working OK.
How possible to solve it? Thanks.