Re: Order of records in a table? Db corrupt?
- From: "Maurice Telkamp" <maurice.myreallastname@xxxxxxxxx>
- Date: Thu, 26 Oct 2006 17:16:32 +0200
Yes, in general you are wrong (sorry), allthough this may vary from engine
to engine.
If you don't include an ORDER BY statement, your resultset is NOT ordered.
Any ordering you seem to see, should be considered random.
hope this helps,
Maurice
"Jacob Havkrog" <a@xxx> wrote in message
news:4540c1bc@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi.
I've got an Access table with autonumber primary key. I connect to the
table from my Delphi 5 application using TAdoConnection and TAdoTable.
When I do
MyTable.First;
while not MyTable.Eof do begin
...
MyTable.Next
end;
I expect to read the record ordered by the primary key. This has also been
the case for a long time.
But suddenly with one table, the records are not sorted properly. I have
tried to repair the database, but it doesn't help.
Am I wrong i expecting, that reading records like above, is equivalent to
reading them like this:
SELECT * FROM mytable ORDER BY myprimarykey
Is the database corrupt?
Thanks for any help!
Jacob
.
- Follow-Ups:
- Re: Order of records in a table? Db corrupt?
- From: Jacob Havkrog
- Re: Order of records in a table? Db corrupt?
- References:
- Order of records in a table? Db corrupt?
- From: Jacob Havkrog
- Order of records in a table? Db corrupt?
- Prev by Date: Order of records in a table? Db corrupt?
- Next by Date: Re: Order of records in a table? Db corrupt?
- Previous by thread: Order of records in a table? Db corrupt?
- Next by thread: Re: Order of records in a table? Db corrupt?
- Index(es):
Relevant Pages
|