| 发表于:2008-01-08 15:14:426楼 得分:2 |
'假如数据是显示在msflexgrid网格中 rs.open "select * from 表1 order by cus", db, adopendynamic, adlockoptimistic n=rs.recordcount msflexgrid1.formatstring=" < ¦^ cus ¦^ 猪肉 ¦^牛肉" msflexgrid1.rows=n+1 msflexgrid1.cols=4 rs.movefirst for i=1 to n+1 msflexgrid1.textmatrix(i, 1)=rs!cus '国家 rs1.open "select * from 表1 where cus='"& msflexgrid1.textmatrix(i,1) &"'" and mat='猪肉'",db, adopendynamic, adlockoptimistic rs2.open "select * from 表1 where cus='"& msflexgrid1.textmatrix(i,1) &"'" and mat='牛肉'",db, adopendynamic, adlockoptimistic msflexgrid1.textmatrix(i, 2)=rs!money '猪肉价格 msflexgrid1.textmatrix(i, 3)=rs!money '牛肉价格 rs.movenext next | | |
|