delphi数据库字段数量方法
delphi数据库字段数量方法 方法1:sql2000查询语句 ---------------------------------- declare @objid int,@objname char(40) set @objname = 'a'--表名称 select @objid = id from sysobjects where id = object_id(@objname) select 'Column_name' = name from syscolumns where id = @objid order by colid 1:sql2000查询语句 ---------------------------------- 方法2:ADOQuery的FieldList的Count属性 ADOQuery1.FieldList.Count:integer ---------------------------------- 方法3:grid的Columns的Count属性 cxgrid: cxGrid1DBBandedTableView2.ColumnCount; dbgrid: DBGrid1.Columns.Count;