有一数据表ax.dbf,字段若干
有一表单,设置表格控件1个(grid1),按钮控件5个(功能分别为打开表、分页、上一页、下一页、关闭表)
假设所有文件都放在桌面上
要实现的功能是分页浏览
表单init代码
public rno,rc,pno,pc
SET SAFETY OFF
set path to C:/Documents and Settings/jwc/桌面/
打开表按钮click代码
select (select(1))
use ax.dbf
thisform.lockscreen=.t.
thisform.grid1.recordsourcetype=1
thisform.grid1.recordsource="ax"
thisform.lockscreen=.f.
分页按钮click代码
thisform.lockscreen=.t.
close databases
select (select(1))
use ax
goto top
rno=recno()
rc=reccount()
pno=1
pc=iif(rc/5-int(rc/5)>0,int(rc/5)+1,int(rc/5))
if file("axtemp.dbf")
if used("axtemp")
select axtemp
use
endif
delete file ax.temp
endif
copy to axtemp next 5
select (select(1))
use axtemp<