long ll_cnt
if sqlca.DBHandle() > 0 then
select count(*) into :ll_cnt from 表;
if sqlca.sqlcode = -1 then
messagebox('', '表不存在')
else
//表存在
end if
else
//连接无效
end if
ms sqlserver 2000
例子
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[charge_invoice]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[charge_invoice]