Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ClientDataSet.AppendRecord "Key Violation"

Status
Not open for further replies.

matiasUTN

Programmer
Joined
Aug 29, 2006
Messages
5
Location
AR
I am using ClientDataSet with DataSnap in way cache, and want to add a record by means of .AppendRecord and obtain except “Key Violation”. The table to which I want to add record has 6 keys and is indexed by these in the DB. I have already proven to by hand enter the values in the DB and the engine thus accepts them without problems I discard that except comes from the engine. All this before happens even to make a UpdateRecord that is that happens in the cache.
Eg.
DM.CDSEntidad.AppendRecord ([12.0.4.4.1.3, “tex1”]); Ok
DM.CDSEntidad.AppendRecord ([12.0.4.4.1.4, “tex2”]); Key Violation

The only thing which I found of different is that the last index is of type ftLageint and the others are to ftInteger but I do not create is that the problem.

In the RDBMS:
INSERT INTO Entidad (VALUES(12,0,4,4,1,3,'tex1'); Ok
INSERT INTO Entidad (VALUES(12,0,4,4,1,4,'tex1'); Ok

Some idea of which it can be happening? Greetings and thanks.
 
Code:
DM.CDSEntidad.AppendRecord ([12.0.4.4.1.3, “tex1”]); Ok 
                               ^ ^ ^ ^ ^

Points? In an array of const? Is that right? Is the compiler seeing 7 fields there?

buho (A).
 
Sorry: the record has 7 fields indexed by the first 6 keys and are "," not "." I was confused.
The last field is not part of the key.
Thanks to respond buho.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top