RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDatabase.GetTableNames Method

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

Pascal
procedure GetTableNames(List: TStrings; SystemTables: Boolean = False);
C++
__fastcall GetTableNames(TStrings 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 ordinary tables. 

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

Database1.GetTableNames(ListBox1.Items, False);

 

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

 

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