Hi, I would like to insert some records from real table to temporary table using RecordRef, but unfortunately it doesn't work, It says the record already exists in table already the first time it enters the loop. The real table 13010988 is not empty, but since I want to store records in temporary instance of it, that shouldn't matter. Does anyone know what could be the problem, thanks.
FERecR2.OPEN(13010988,TRUE);
//FERecR2.SETTABLE(FERecTmp);
REPEAT
MESSAGE(FORMAT(FERecR2.COUNT));
FERecR2 := FERecR;
FERecR2.INSERT;
UNTIL FERecR.NEXT = 0;
MESSAGE('%1',FERecTmp.COUNT);
Comments
The error you get is because your RecordRef is pointing to the actual table.
A recordreference is like a pointer to some data and you just assign the pointer to another variable BUT THEY BOTH POINT TO THE SAME DATA!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!