RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSQLConnection.GetTableNames Method (TStrings, Boolean)

Populates a string list with the names of tables in the database.

Pascal
procedure GetTableNames(List: TStrings; SystemTables: Boolean = False); overload;
procedure GetTableNames(List: TStrings; SchemaName: WideString; SystemTables: Boolean = False); overload;
procedure GetTableNames(List: TWideStrings; SchemaName: WideString; SystemTables: Boolean = False); overload;
procedure GetTableNames(List: TWideStrings; SystemTables: Boolean = False); overload;
C++
__fastcall GetTableNames(TStrings List, Boolean SystemTables = False);
__fastcall GetTableNames(TStrings List, BSTR SchemaName, Boolean SystemTables = False);
__fastcall GetTableNames(TWideStrings List, BSTR SchemaName, Boolean SystemTables = False);
__fastcall GetTableNames(TWideStrings List, Boolean SystemTables = False);

Call GetTableNames to retrieve a list of tables in the associated database.  

List is a TStrings descendant that receives the table names. Any existing strings are deleted from the list before GetTableNames adds the names of all tables in the database. 

SystemTables specifies whether the list of table names should include only the database's system tables. If SystemTables is true, only the system tables are added to List. If SystemTables is false, the list is filled with any tables that match the criteria specified by the TableScope property. 

For example, the following line fills a list box with the names of all data tables in the database:

SQLConnection1.GetTableNames(ListBox1.Items, False);

 

SQLConnection1->GetTableNames(ListBox1->Items, false);

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!