接上
string ls_sno
long ll_tempno3
treeviewitem l_tvi3
declare cur1 cursor for
select distinct majoryno
from tong;
open cur1;
fetch cur1 into :lxc;//t先插入兩判斷
do while SQLCA.sqlcode = 0
l_tvi.label= lxc
l_tvi.data=1
ll_tempno2=tv_1.insertitemfirst(ll_tempno1, l_tvi)
declare cur2 cursor for
select distinct sno
from tong
where ....;
open cur2;
fetch cur2 into :ls_sno;
do while SQLCA.sqlcode = 0
if isnull(ls_sno) then
ls_sno= ''
end if
ll_tempno3 = this.insertitemsort(ll_tempno2,ls_sno,1)
this.getitem(ll_tempno3,l_tvi3)
l_tvi3.data = ls_sno
l_tvi3.pictureindex = 1
l_tvi3.selectedpictureindex =2
this.setitem(ll_tempno3,l_tvi3)
fetch cur2 into :ls_no;//最後也要加上這個
loop
close cur2;
fetch cur1 into :lxc;
loop
close cur1;
二級的科目,也按三級的科目相應修改,我就不做相應改正。