| 发表于:2007-05-02 14:34:254楼 得分:0 |
'*********分页显示的函数*********** private function gridshow(pageno as integer, b1 as string) on error resume next call sql1 ‘数据库连接 bbak = b1 c_proj.open b1 while not c_proj.eof pagesum = pagesum + 1 c_proj.movenext wend c_proj.movefirst pagesum = cint(pagesum / 20) + 1 c_proj.pagesize = 20 c_proj.absolutepage = pageno pagesum = c_proj.pagecount with mshflexgrid1(sstab1.tab) .clear .rows = c_proj.pagesize + 2 .cols = 7 .textmatrix(0, 1) = p(0) .textmatrix(0, 2) = p(1) .textmatrix(0, 3) = p(2) .textmatrix(0, 4) = p(3) .textmatrix(0, 5) = p(4) .textmatrix(0, 6) = p(5) for i = 1 to c_proj.pagesize if c_proj.eof then if cpage > pagesum then msgbox "没有可供显示的记录!请确认! " goto close1 end if end if .textmatrix(i, 0) = " " & cstr((pageno - 1) * 20 + i) '第一行显示的为序号 .textmatrix(i, 1) = " " & c_proj.fields(pb(0)) .textmatrix(i, 2) = " " & c_proj.fields(pb(1)) .textmatrix(i, 3) = " " & c_proj.fields(pb(2)) .textmatrix(i, 4) = " " & c_proj.fields(pb(3)) .textmatrix(i, 5) = " " & c_proj.fields(pb(4)) .textmatrix(i, 6) = " " & c_proj.fields(pb(5)) c_proj.movenext next i txtgopage = cpage txtshow = "共 " & pagesum & "页 " close1: c_proj.close end with end function 我设置的首页 下一页 上一页 的按钮,调用此函数均无问题 | | |
|