我急啊,高手门,我找了许多资料都没查到,在ACSS数据库里,通过数据类型,查询到相对应里字段名(100分)

  • 主题发起人 主题发起人 woaini911pp
  • 开始时间 开始时间
W

woaini911pp

Unregistered / Unconfirmed
GUEST, unregistred user!
通过ACSS数据类型,查询到与类型匹配的字段名,显示在COMBOX上面,我是新手请写详细点,摆脱.分不够在加先100分
 
不太明白什么意思...
query1.sql.text := 'select * from table';
query1.open;

for i := query1.fieldcount -1 do
begin
if query1.fields is TStringField then
combobox1.items.add('字符型');
if query1.fields is TDateTimeField then
combobox1.items.add('日期型');

....
end;
 
问题好象说的不清楚,你没有说明查询条件吧.你要查询与什么类型一致的字段呢?
 
acess不太熟,通过DATASET也可以达到,
for i:=0 to dataset.Fields.Count-1 do
begin
if dataset.field is tstringfield then
begin
if combox1.text='字符型' then
combox2.add(dataset.field.fieldname)
end
else if dataset.field is tbcdfield then
begin
end.....

end
 

Similar threads

回复
0
查看
1K
不得闲
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
926
SUNSTONE的Delphi笔记
S
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部