synonym to setkey or findkey

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Josef Koller
Junior Boarder
Junior Boarder
Posts: 26
Joined: 04.09.2005, 14:46

synonym to setkey or findkey

Post 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
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post by btrewern »

I've never used setkey or findkey but I think Locate will give you similar fuctionality.

Regards,

Ben
Josef Koller
Junior Boarder
Junior Boarder
Posts: 26
Joined: 04.09.2005, 14:46

Post 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
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post 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
btrewern
Expert Boarder
Expert Boarder
Posts: 193
Joined: 06.10.2005, 18:51

Post 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
Post Reply