Board index » delphi » TQuery - linking notebook pages (searching algorithms)

TQuery - linking notebook pages (searching algorithms)

We have a notebook of about 12 pages, each page displays info from
different databases for a given employee number. Each page then has a
TQuery, ordered by employee number. As the user changes tabs we want info
for the same employee number to appear on each page. The problem is that
TQuery does not support index-based searches, so it seems we need to have
a searching algorithm for each page?

Would a b-tree algorithm be the fastest?

Has anyone else experimented with a solution to a similiar problem? [we
would cope with anything from 10 to 1500+ employee numbers].

Thanks.

Tom.

 

Re:TQuery - linking notebook pages (searching algorithms)


Quote
> tomcorc...@aol.com (TomCorcora) wrote in article

<4plboh$...@newsbf02.news.aol.com>...
Quote
> We have a notebook of about 12 pages, each page displays info from
> different databases for a given employee number. Each page then has a
> TQuery, ordered by employee number. As the user changes tabs we want
info
> for the same employee number to appear on each page. The problem is that
> TQuery does not support index-based searches, so it seems we need to
have
> a searching algorithm for each page?

> Would a b-tree algorithm be the fastest?

> Has anyone else experimented with a solution to a similiar problem? [we
> would cope with anything from 10 to 1500+ employee numbers].

> Thanks.

> Tom.

Seems that a parameterized query is what you want here.

your sql statement would look like:
Select * from Employees where EmployeeNumber = :a

Then you code to execute the quries would be
ThisEmployeeNumber := 13;
Query1.params[0] := ThisEmployeeNumber;
Query1.Open;

Other Threads