Page 1 of 1

Tunitable.keyfields property problem

Posted: Sat 14 Jan 2012 20:01
by jota
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?

Posted: Mon 16 Jan 2012 09:14
by AlexP
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';