RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLConnection.GetFieldNames Method (WideString, TWideStrings)

Populates a string list with the names of fields in a table.

Pascal
procedure GetFieldNames(const TableName: WideString; SchemaName: WideString; List: TWideStrings); overload;
procedure GetFieldNames(const TableName: WideString; List: TWideStrings); overload;
C++
__fastcall GetFieldNames(const BSTR TableName, BSTR SchemaName, TWideStrings List);
__fastcall GetFieldNames(const BSTR TableName, TWideStrings List);

Call GetFieldNames to retrieve a list of fields in a table.  

TableName names the table whose field names you want added to the list. 

List is a TStrings descendant that receives the field names. Any existing strings are deleted from the list before GetFieldNames adds the names of all the fields in TableName. 

For example, the following line fills a list box with the names of all fields in the Employee table:

SQLConnection1.GetFieldNames('Employee', ListBox1.Items);

 

SQLConnection1->GetFieldNames("Employee", ListBox1->Items);

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!