Article View: borland.public.cppbuilder.database.ado
Article #2172Re: TADOTable Out of Order
From: Robert Emmons
Date: Fri, 31 Oct 2003 17:22
Date: Fri, 31 Oct 2003 17:22
31 lines
2271 bytes
2271 bytes
On Fri, 31 Oct 2003 11:36:35 -0500, "Arnie Mauer" <xxx@nowhere.net> wrote: >"Robert Emmons" <remmons@aurigen.com> wrote in message >news:1vv4qvcl4irnt8ln5t1p31ge0cshk96s6s@4ax.com... >> >> DataSource->DataSet->Tbl->Active = true >> DataSource->DataSet->Tbl->IndexName = PrimaryKey > >Shouldn't you set the IndexName before you activate the table? > Yes. Sorry about the confusion. First, I set Active=false. Next, I set the IndexName. Finally, I set Active=true. I did it all at design time, not in code, so I could not set the IndexName at all if I did not set Active=false first. > >An index does not guarantee the order of the returned rows. This is defined >in ANSI SQL. Either use an ORDER BY clause on a query object or the SORT >property of a table object. From BCB Help: > ORDER BY applies to queries. I am not displaying a query in the TDBGrid. I am displaying a TADOTable. I do not see a SORT property in the propeties list of the TADOTable object. The table has an IndexName property with a drop down list that shows all defined indexes. I choose an index. I set Active=true, and the grid does not show the table in order by the specified index. Instead, the table is displayed in actual record order. How can I get the table to appear in proper order in the TDBGrid?
Technical Details
Message-ID:
<th65qvshuums191dug1vh6ejhv6h5kg3q5@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<1vv4qvcl4irnt8ln5t1p31ge0cshk96s6s@4ax.com> <3fa28f67@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,b4ab9cb102f7ab18 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-10-31 09:39:49 PST From: Robert Emmons <remmons@aurigen.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: TADOTable Out of Order Date: Fri, 31 Oct 2003 12:22:51 -0500 Message-ID: <th65qvshuums191dug1vh6ejhv6h5kg3q5@4ax.com> References: <1vv4qvcl4irnt8ln5t1p31ge0cshk96s6s@4ax.com> <3fa28f67@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 68.193.14.50 X-Trace: newsgroups.borland.com 1067620959 68.193.14.50 (31 Oct 2003 09:22:39 -0700) Lines: 32 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail