 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ken Fletcher Guest
|
Posted: Mon May 23, 2005 5:11 pm Post subject: How do I sort an ADO Table? |
|
|
When adding records to an ADO table, the table does not get sorted so that
the new record is where it should be in an alpha sort. It just appends the
record to the end of the table. But, if I open the same table in MS Access
2003, the new item is displayed in its proper place.
How can I sort the ADO table from within Dephi?
|
|
| Back to top |
|
 |
Dan Guest
|
Posted: Mon May 23, 2005 6:06 pm Post subject: Re: How do I sort an ADO Table? |
|
|
On Mon, 23 May 2005 10:11:34 -0700, "Ken Fletcher"
<fletchek (AT) nwlink (DOT) com> wrote:
| Quote: | When adding records to an ADO table, the table does not get sorted so that
the new record is where it should be in an alpha sort. It just appends the
record to the end of the table. But, if I open the same table in MS Access
2003, the new item is displayed in its proper place.
How can I sort the ADO table from within Dephi?
In general, you don't physicall sort the underlying table, you should |
apply an index so the records will appear in the desired order to the
user. This is probably what Access is doing.
This applies also when you are stepping through a table in some
procedure which has to process the rows in a particular order. There
are some special cases when sorting a table will improve performance.
If you are interested I can probably find some postings to this ng
that I can send you.
HTH,
Dan
|
|
| Back to top |
|
 |
Ken Fletcher Guest
|
Posted: Mon May 23, 2005 8:37 pm Post subject: Re: How do I sort an ADO Table? |
|
|
I have programmed for years using the BDE in Dephi and am just beginning to
use ADO so I can access ACCESS tables. BDE table components will not access
ACCESS tables. In ACCESS I try to place a key on the table and it says it
cannot to it because it would create duplicate records, even when I select
enough fields to break the problem. I don't even know where to begin with
the ADO. I even tried some SQL calls and can't get that to work either.
There doesn't seem to be much help on the internet either.
Ken
"Dan" <Doculus at CMDCsystems dot com> wrote
| Quote: | On Mon, 23 May 2005 10:11:34 -0700, "Ken Fletcher"
[email]fletchek (AT) nwlink (DOT) com[/email]> wrote:
When adding records to an ADO table, the table does not get sorted so that
the new record is where it should be in an alpha sort. It just appends
the
record to the end of the table. But, if I open the same table in MS
Access
2003, the new item is displayed in its proper place.
How can I sort the ADO table from within Dephi?
In general, you don't physicall sort the underlying table, you should
apply an index so the records will appear in the desired order to the
user. This is probably what Access is doing.
This applies also when you are stepping through a table in some
procedure which has to process the rows in a particular order. There
are some special cases when sorting a table will improve performance.
If you are interested I can probably find some postings to this ng
that I can send you.
HTH,
Dan
|
|
|
| Back to top |
|
 |
Bruce Roberts Guest
|
Posted: Tue May 24, 2005 2:08 pm Post subject: Re: How do I sort an ADO Table? |
|
|
"Ken Fletcher" <fletchek (AT) nwlink (DOT) com> wrote
| Quote: | I have programmed for years using the BDE in Dephi and am just beginning
to
use ADO so I can access ACCESS tables. BDE table components will not
access
ACCESS tables. In ACCESS I try to place a key on the table and it says it
cannot to it because it would create duplicate records, even when I select
enough fields to break the problem. I don't even know where to begin with
the ADO. I even tried some SQL calls and can't get that to work either.
There doesn't seem to be much help on the internet either.
|
One has to be mindful of fields that contain null values.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|