ssql3:='select count(*) as qq from tab_stafftrain where sta_id='''+EdtSta_id.Text+''' and cur_id='''+EdtCur_id.Text+''' ';
这一句,如果sta_id、cur_id为整型的话,此句改成
ssql3:='select count(*) as qq from tab_stafftrain where sta_id='+EdtSta_id.Text+' and cur_id='+EdtCur_id.Text+';showmessage(inttostr(datamodule1.CDS_Total.FieldByName ('qq').asinteger)); 改成:
showmessage(datamodule1.CDS_Total.FieldByName ('qq').asstring);
这一句,如果sta_id、cur_id为整型的话,此句改成
ssql3:='select count(*) as qq from tab_stafftrain where sta_id='+EdtSta_id.Text+' and cur_id='+EdtCur_id.Text+';showmessage(inttostr(datamodule1.CDS_Total.FieldByName ('qq').asinteger)); 改成:
showmessage(datamodule1.CDS_Total.FieldByName ('qq').asstring);
试一下换成
showmessage(datamodule1.CDS_Total['qq']);
field type 為 calculated
不對.
to : snakeguo(枫)
count(*)值為1,不可能越界.
两层结构的程序没有问题,三层结构的程序为何就出错呢 ?