Hello
I want to call Locate method on a TUniTable component in order to search a particular record.
Then i want to go back to the previous record.
How should i do ?
There is no « current position » property on TUniTable. I saw an « active record » property in source code but this property is not accessible.
I am working on Delphi
Thanks for your answer
Save current position in UniTable
-
testpresta
- Posts: 32
- Joined: Sat 07 Jun 2014 19:41
Re: Save current position in UniTable
Just a remark. I noticed there is a recno property but this property is not correct when the UniTable is sorted.
The numbers are re-affected...
Thanks
The numbers are re-affected...
Thanks
Re: Save current position in UniTable
Hello,
You can use GetBookmark, GotoBookmark, and FreeBookmark.
Best Regards,
Cristian Peta
You can use GetBookmark, GotoBookmark, and FreeBookmark.
Best Regards,
Cristian Peta
Re: Save current position in UniTable
Hello,
For this, you can save the value of the key field for the current record, and after all operations return to the required record using the Locate method:
For this, you can save the value of the key field for the current record, and after all operations return to the required record using the Locate method:
Code: Select all
var
empno: integer;
begin
UniTable1.SQL.Text := 'SELECT * FROM EMP';
UniTable1.OrderFields := 'ENAME ASC';
UniTable1.KeyFields := 'EMPNO';
UniTable1.Open;
empno := UniTable1.FieldByName('empno').AsInteger;
UniTable1.LocateEx('EMPNO', 7788, []);
UniTable1.OrderFields := 'ENAME DESC';
UniTable1.LocateEx('empno', empno, []);
end;-
testpresta
- Posts: 32
- Joined: Sat 07 Jun 2014 19:41
Re: Save current position in UniTable
Thanks for your answers.
Bookmarks are the same than Recno. If i order by the table it gives a mistake...
Working with primary key is a good idea but i want to do something generic for several UniTables objects.
Thanks
Bookmarks are the same than Recno. If i order by the table it gives a mistake...
Working with primary key is a good idea but i want to do something generic for several UniTables objects.
Thanks
Re: Save current position in UniTable
We plan to improve work with Bookmark, in order to avoid such situations. However, we cannot tell the exact terms of implementation of this feature.