Page 1 of 1
synonym to setkey or findkey
Posted: 22.01.2006, 23:02
by Josef Koller
Hi,
is there any synonym function or procedure to setkey or findkey in Zeos table?
I would like to set the cursor to a defined datarecord.
Thanks
Josef
Posted: 23.01.2006, 00:48
by btrewern
I've never used setkey or findkey but I think Locate will give you similar fuctionality.
Regards,
Ben
Posted: 23.01.2006, 09:21
by Josef Koller
Hi,
yes I found locate, but locate don't use indices and is not to fast. Setkey, ect. was better in my old paradox/delphi environment.
My problem: I have a dbgird with a joined query as datasource. The user sets the cursor to a record. Than I would like to edit the original record some of the based tables.
So I would like to set the cursor to the original record like this.
ztable1.setkey;
ztable1.fieldbyname('ID').asinterger:=zquery1.fieldbyname('ar.id').asinteger;
ztable1.gotokey;
Any ideas to set the cursor to a record in a based table like this?
Kind regards
Josef
Posted: 23.01.2006, 14:48
by btrewern
If you look at the help page for Locate I think you'll find that it's supposed to use indexes. I'm not sure if this is true of zeos but I've never had problems with using it.
Changing from file based databases to RDBMS you will have to change the way you work slightly.
Regards,
Ben
Posted: 23.01.2006, 14:50
by btrewern
I've just looked at your question again and it looks like you need to use a TZupdateSQL component. See TUpdateSQL in the Delphi help.
Regards,
Ben