请问如何在控件内显示库中所有的表?(100分)

  • 主题发起人 主题发起人 bon
  • 开始时间 开始时间
B

bon

Unregistered / Unconfirmed
GUEST, unregistred user!
比如在一个listbox中显示!
 
Populates a string list with the names of tables in the database.

procedure GetTableNames(List: TStrings; SystemTables: Boolean = False);

Description

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

List is the already-existing string list object into which the tables names are put.

Set SystemTables to indicate whether the list of table names should include the database抯 system tables.

ADOConnection1.GetTableNames(ListBox2.Items, False);

 
能不能写的详细一点,最好有注释。
 
李维的 ADO MTS COM+ 书里面有详细介绍
 
用TDatabase控件的GetTableNames方法就可以了,若是在ListBox里显示,用
Database1.GetTableNames(ListBox1.Items, True)就可以了
 
如果用ADO
var
TableList:Tstrings;
i:integer;
begin
Tablelist:=Tstringlist.Create;
adoconnection1.GetTableNames(Tablelist);
for i:=0 to (TableList.Count-1) do begin
listbox1.Items.Append(TableList)
end;
end;
 
后退
顶部