Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread List the fields in the table
Sun, Sep 3 2006 3:11 PMPermanent Link

Jerry Blumenthal
How do I get a list of the fields in the table?  Does the table have to
be OPEN?  (via a query or a table?)

Jerry
Mon, Sep 4 2006 3:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jerry


FieldDefs and iterate through, and I think the table has to be open. If you want an example look at the reverse engineering code in DBSys.


Roy Lambert
Mon, Sep 4 2006 12:45 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jerry,

<< How do I get a list of the fields in the table?  Does the table have to
be OPEN?  (via a query or a table?) >>

As Roy said, just use the FieldDefs property:

with MyTable do
  begin
  FieldDefs.Update;
  for I:=0 to FieldDefs.Count-1 do
      <<<<<<<  Code here to add field name to list, etc.
  end;

or you can use the GetFieldNames method:

GetFieldNames(List: TStrings)

And, no, the table does not have to be open for either method.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Sep 4 2006 4:31 PMPermanent Link

Jerry Blumenthal
Tim Young [Elevate Software] wrote:
> Jerry,

> or you can use the GetFieldNames method:
>
> GetFieldNames(List: TStrings)
>
> And, no, the table does not have to be open for either method.
>


Worked really well on a dbisamTABLE.

I dont really have a problem with this, but is there a way to use a
query instead of a table?

jerry
Tue, Sep 5 2006 4:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jerry,

<< I dont really have a problem with this, but is there a way to use a query
instead of a table? >>

Not with DBISAM, no.  At least not without creating a temporary table first
that is populated using the methods that I've already described.  However,
you can do so with the upcoming ElevateDB.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image