就这个程序如何到分页显示
我的查询程序如下 一页现在是1000 要让其一页显示100 Private Sub Command2_Click()
On Error GoTo 0
Dim sPro, sSer, sCon, sDsn, DSNName
Dim conn1, oRs1, oCom1, sSql1, m, conn2, oRs2, oCom2, sSql2
' Dim conn1, oRs1, oCom1, sSql1, m,
Dim oList, oItem, i, j
Dim WinCC As Object
Set WinCC = CreateObject("WinCC-Runtime-Project")
Dim database
database = WinCC.GetValue("@DatasourceNameRT")
sPro = "Provider=WinCCOLEDBProvider.1;"
sDsn = "Catalog= " & database & ";"
sSer = "Data Source=.\WinCC;User ID=sa;"
sCon = sPro & sDsn & sSer
Text1.Text = DateAdd("h", -8, DTPicker1)
Text2.Text = DateAdd("h", -8, DTPicker2)
' sSql = "TAG:R,('PV\F1';'PV\F2'),'" & Text1.Text & "','" & Text2.Text & "'"
sSql1 = "TAG:R,('PV\F1'),'" & Text1.Text & "','" & Text2.Text & "'"
sSql2 = "TAG:R,('PV\F2'),'" & Text1.Text & "','" & Text2.Text & "'"
Set conn1 = CreateObject("ADODB.Connection")
conn1.ConnectionString = sCon
conn1.CursorLocation = 3
conn1.Open
Set oRs1 = CreateObject("ADODB.Recordset")
Set oCom1 = CreateObject(")
= 1
Set oCom1.ActiveConnection = conn1
= sSql1
Set oRs1 = oCom1.Execute
Set conn2 = CreateObject("ADODB.Connection")
conn2.ConnectionString = sCon
conn2.CursorLocation = 3
conn2.Open
Set oRs2 = CreateObject("ADODB.Recordset")
Set oCom2 = CreateObject(")
= 1
Set oCom2.ActiveConnection = conn2
= sSql2
Set oRs2 = oCom2.Execute
flex2.Clear
If (Not oRs1.EOF) Then
oRs1.MoveFirst
i = 1
Do While Not oRs1.EOF
flex2.TextMatrix(i, 1) = i
flex2.TextMatrix(i, 2) = DateAdd("h", 8, oRs1.Fields(1).Value)
flex2.TextMatrix(i, 3) = CStr(oRs1.Fields(2).Value)
flex2.TextMatrix(i, 4) = CStr(oRs2.Fields(2).Value)
oRs1.MoveNext
oRs2.MoveNext
i = i + 1
Loop
oRs1.Close
oRs2.Close
End If
Set oRs1 = Nothing
Set oCom1 = Nothing
Set conn1 = Nothing
Set oRs2 = Nothing
Set oCom2 = Nothing
Set conn2 = Nothing
End Sub
Private Sub flex2_Click()
End Sub
Private Sub Form_Activate()
flex2.Rows = 1000
flex2.Cols = 5
'设置列标头。
s$ = "^|^序号 |^ 时间 |^ 压力 |^ 温度 "
flex2.FormatString = s$
End Sub
Private Sub Form_Load()
End Sub