NULL OBJECT REFERENCE求大虾
if dw_1.update() =1 and dw_2.update()=1 then
commit;
MessageBox('提示','数据保存成功。')
close(parent)
else
rollback;
end if
string p1,c1
int n1,n2,n3,i
integer li_count
for i=1 to dw_2.rowcount()
p1=dw_2.getitemstring(i,"pro_code")
n1=dw_2.getitemnumber(i,"cksl")
c1=dw_1.getitemstring(1,"ck_code")
select count(*) into :li_count from kctj where pro_code=:p1 and ck_code=:c1;
if li_count>0 then
select kcl into :n2
from kctj
where pro_code=:p1 and ck_code=:c1;
n3= n2 -n1
update kctj
set kcl=:n3
where pro_code=:p1 and ck_code=:c1;
elseif li_count=0 then
insert into kctj(pro_code,ck_code,kcl)
values (:p1,:c1,-:n1);
end if
next
程序运行后,显示红色字体部分:null object reference
但相同的程序我在入库单是就能运行。。。。求大虾们帮忙解决