比如有一张表create table student
(
no char(4),
name char(10) not null ,
class char(20),
teacher char(10),
primary key(no)
)AdoQuery1.sql.text:='select * from student';
AdoQuery1.fields[1] 对应的字段为 name ,所以 AdoQuery1.fields[1] 不能为空
AdoQuery1.fields[2] 对应的字段为 class ,所以 AdoQuery1.fields[2] 可以为空;
现在如何判断 AdoQuery1.fields 各个字段能否为空?其实我是想实现下面的功能:
for i:=0 to AdoQuery1.fieldcount-1 do
begin
if AdoQuery1.fields[i].canNull then
showmessage('该字段可以为空!');
end;当然,没有 AdoQuery1.fields[i].canNull 这种写法,我只是表达这个意思;不知道该如何实现这个功能?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货