Finding record

Freature requests from users for ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist, mdaems

wahono
Junior Boarder
Junior Boarder
Posts: 32
Joined: 30.07.2007, 16:20
Location: Indonesia
Contact:

Finding record

Postby wahono » 23.01.2008, 14:40

Your ZeosLib DBO Version:
The IDE you are using: Lazarus
Version (and maybe patchlevel) of the IDE:
The database you are using: MySQL
Version of the database: 5.1
Used protocol:
[hr]Error description and post

I don't found function to find record in tzquery or tzreadonlyquery except 'locate'. In DAO, there are many function to find record and several criteria. For example : 'findfirst' to find record from first record, 'findnext' to find next record from current record, 'findprevious' to find previous record from current record, and 'findlast' to find record from last record position. And in DAO the criteria to find record is like filter criteria. We can find record with this possiblility :

obj.findfirst('id=''code001''');
obj.findfirst('name like ''machine*''');
obj.findnext('id=''code001'' and name like ''machine*''');
etc.

If we use grid to show record set. Find with this function doesn't reload query so just move record position to founded record. If we use filter the recordset/resultset where is not matching is not visible again.

Is ZeosLib has these function?

In question when we post, there is question 'The IDE you are using'. And MSEide+MSEgui is none. I think Martin named for IDE wiith MSEide+MSEgui is not match with marketing concept. Hardly to remember. :)

regards,
wahono

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 23.01.2008, 15:53

The zeosdbo components are TDataset descendants. I don't know exactly what search possibilities are provided by a MSE/FPC TDataset.

Looking at the FPC source I've found

Code: Select all

    function FindFirst: Boolean;
    function FindLast: Boolean;
    function FindNext: Boolean;
    function FindPrior: Boolean;
    function Locate(const keyfields: string; const keyvalues: Variant; options: TLocateOptions) : boolean; virtual;
    function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant;
    property Found: Boolean read FFound;
    property Filter: string read FFilterText write SetFilterText;
    property Filtered: Boolean read FFiltered write SetFiltered default False;
    property FilterOptions: TFilterOptions read FFilterOptions write SetFilterOptions;


I'm afraid you'll have to do it with these. Their behaviour should be documented in the FPC documentation. If they don't work as expected with zeoslib, please file a bug report on our bugtracker (http://zeosbugs.firmos.at/).
AFAIK we don't provide extra search possibilities. Of course, if you write some custom function to support more complex searches in a TDataset using these standard functions we can embed it in zeoslib if it makes sense and the code doesn't depend on features that are not supported on D5-D11 or FPC.
Image

wahono
Junior Boarder
Junior Boarder
Posts: 32
Joined: 30.07.2007, 16:20
Location: Indonesia
Contact:

Postby wahono » 23.01.2008, 16:23

But these functions (findfirst, findlast, findnext,findprior) in tdataset is empty. I can't use it. And in fpc documentation, I can't found this function.

User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Postby mdaems » 23.01.2008, 16:55

Oh... That's the request. Stupid me... :oopsp: :wallb:
Image

wahono
Junior Boarder
Junior Boarder
Posts: 32
Joined: 30.07.2007, 16:20
Location: Indonesia
Contact:

Postby wahono » 23.01.2008, 17:22

:)

wahono
Junior Boarder
Junior Boarder
Posts: 32
Joined: 30.07.2007, 16:20
Location: Indonesia
Contact:

Postby wahono » 23.01.2008, 17:29

:)


Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest