如何得到打开的数据中(MDB)里的所有表的名称(10分)

  • 主题发起人 风无影
  • 开始时间

风无影

Unregistered / Unconfirmed
GUEST, unregistred user!
如何得到打开的数据中(MDB)里的所有表的名称,还有在C/S中呢,比如我要删除表,如何先
判断是否存在,很菜的问题。
 
参考sp_tables sp_help等procedure
 
假设你使用 ADOEXPRESS
TADOConnection.GetTableNames
 
同意 savetime 的方法
SQL可以这样
---- 数量单位
if exists (select * from sysobjects
where id = object_id('dbo.um'))
drop table dbo.um
create table um (
um TyShortCode not null primary key ,
descr varchar(16) null,
umtype char(1) not null
)
GO

但临时表用的是tmpdb的过程

 
是得到数据库是所有表的名称,比如把这些表的名称添加到一个列表中,能发个例子吗?
landai@km169.net
 
ADOConnection1.GetTableNames(ListBox1.Items, True);
^^^^
True 是否包含系统表
 
同意savetime
 
来晚了,也不知有没有分。
AdoConnection1.GetTableNames(List:TStrings;[SystemTables = False]);
 
顶部