You are not logged in.
Pages: 1
I got a table with a 1:1 reference to another and when retrieving values, when the Id is too high, I'm getting an AV, what should I do ? The ID is over $100000 and this messes up the ORM
on the TSQLRecord:
property reg : TReg0200 read fReg write fReg; //this is another TSQLRecord
loading data:
...
RetrieveList<TAgrupamentoConsistencia>('', []);
...
for obj in list do
obj.reg := TReg0200.Create(Server, obj.reg.Id);
also tried obj.reg , obj.reg.AsTSQLRecord
Offline
Your code is incorrect, or incomplete.
You use obj.reg.ID before setting obj.reg.
So instances and IDs are confused...
Try with TID(obj.reg).
Note that even if it worked, obj.reg instance are most probably not freed - so you leak memory.
Offline
I free it later, that list in the for is the one retrieved by RetrieveList , I already fixed changing the SQLRecord to TID and loading on another field, gonna try TID(object) next time, thanks
Offline
Pages: 1