设置RE_DATA的pagesize,然后使用absolutetpaget指定要显示的页,再调用MshFlexgrid.refresh
解决方案 »
- VB编译错误:缺少:New或类型名??????????????????
- VB如何运行某一子框架的JS代码?
- VB里面如何让DLL给exe发送消息和数据?用什么方法?
- VB调用C#编译的DLL请大家指教我一下
- my trouble
- 用mshflexgrid更新数据的时候,怎样处理sql异常
- 在线等待:怎么使用结构体做参数?
- ini操作问题非常紧急,再线等方法好一定给分
- vb6我在向窗体中添加DBGrid时出现:"该部件的许可证信息没有找到,在设计环境中,没有合适的许可证使用该功能"错误,是怎么回事?
- 问一个很急的问题!!
- 以下功能能用sql语句实现吗?在线等待
- 怎么让几个子窗体,在MDI中按照自己的要求布局?
msdn
Public Sub AbsolutePageX()
Dim rstEmployees As ADODB.Recordset
Dim strCnn As String
Dim strMessage As String
Dim intPage As Integer
Dim intPageCount As Integer
Dim intRecord As Integer ' Open a recordset using a client cursor
' for the employee table.
strCnn = "Provider=sqloledb;" & _
"Data Source=srv;Initial Catalog=Pubs;User Id=sa;Password=; "
Set rstEmployees = New ADODB.Recordset
' Use client cursor to enable AbsolutePosition property.
rstEmployees.CursorLocation = adUseClient
rstEmployees.Open "employee", strCnn, , , adCmdTable
' Display names and hire dates, five records
' at a time.
rstEmployees.PageSize = 5
intPageCount = rstEmployees.PageCount
For intPage = 1 To intPageCount
rstEmployees.AbsolutePage = intPage
strMessage = ""
For intRecord = 1 To rstEmployees.PageSize
strMessage = strMessage & _
rstEmployees!fname & " " & _
rstEmployees!lname & " " & _
rstEmployees!hire_date & vbCr
rstEmployees.MoveNext
If rstEmployees.EOF Then Exit For
Next intRecord
MsgBox strMessage
Next intPage
rstEmployees.CloseEnd Sub