TIP: Click on subject to list as thread! ANSI
echo: delphi
to: ...
from: BERT PERLITZ
date: 1997-05-06 07:25:00
subject: recordcount-problem

hi, dolphins,
yesterday i got a strange problem. i have a paradox-table which i have
indexed for a field date and a field time. now i want to extract all data
that concerns day x (lets say 10.03.1997 for example). so i create a query
in delphi 1 to get the datas. it lloks like
with qry_data do
begin
  close;
  sql.clear;
  sql.add(format('select * from %s',[datadir]);
  sql.add(format('where date = '''%s''',[datafile]);
  sql.add('order by time');
  open;
end;
i splittet up the sql because the sourcecode is more readable. this works
fine, but i get a dataset which i can't change because it is readonly. this
is caused by the 'order by time' expression. ok, i thought, time is indexed
so the data should be in the right order even if i don't order it
explicitly, and i deleted the order-by-expression. and strange things
happened.
in a subroutine i go through the datas of the sql (with first and next)
from 0 to qry_data.recordcount. and when i don't use the
order-by-expression the recordcount is always the number of all records in
the complete table. can anyone explain me why this happens? i tried several
things out and found that the data i get back is exactly the same that i
get with the order-by. but the recordcount is set to the maximum number and
i can't find the reason.
don't try to understand all...
                  bert the ;-}
--- Terminate 4.00/Pro
---------------
* Origin: it's so hot you could lay an egg on the sidewalk (2:2480/60.10)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.