Tunitable.keyfields property problem

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jota
Posts: 34
Joined: Tue 22 Nov 2011 19:21

Tunitable.keyfields property problem

Post by jota » Sat 14 Jan 2012 20:01

Hello, help please

In a sqlite database i create following structure table

CREATE TABLE "NotTem" (
ClaNot integer NOT NULL,
ClaTem integer NOT NULL,
PRIMARY KEY (ClaNot, ClaTem),
/* Foreign keys */
FOREIGN KEY (ClaNot)
REFERENCES Notas(ClaNot),
FOREIGN KEY (ClaTem)
REFERENCES Temas(ClaTem)
)

Both referenced tables (Temas and Notas) are defined.

In NotTem_Tunitable.keyfields := ClaNot, ClaTem

When i try insert a record in the table an error appear : NotTem_Tunitable: key field 'ClaNot,ClaTem' not found

What´s my error? i can´t define composite key?

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

Post by AlexP » Mon 16 Jan 2012 09:14

Hello,

UniDAC enables specifying of compound keys in the UniQuery1.KeyFields (definition of several fields), the fields in KeyFields must be separated by ";"

Code: Select all

UniQuery1.KeyFields := 'ClaNot; ClaTem';

Post Reply