在datagrid中分页显示时,总显示所有记录出来,是哪一个地方出错了?
部份代码如下:nPageSize = 21
If rs1.State = adStateOpen Then rs1.Close
rs1.Open "select * from db_prod", cnnuser, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rs1 '是不是这个地主出错了?
rs1.PageSize = nPageSize
lPageCount = rs1.PageCount
If lCurrentPage > lPageCount Then
lCurrentPage = lPageCount
End If
rs1.AbsolutePage = lCurrentPage