n\work\program\code\my_code\PrjPagination\bank.mdb;"
a.Open "PROVIDER=Microsoft.Jet.OLEDB.3.51;Data Source=" & App.Path & "\bank.mdb;"
If Not a Is Nothing Then
Set pCon = a
End If
Set a = Nothing
End Sub
Sub InitListViewData()
Dim rs As ADODB.Recordset
Dim s$, lp%, intSize%, sKey$
Dim m As ListItem
lv.ListItems.Clear
intSize = pSize
s = "select * from sort"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
''Set rs = pCon.Execute(s)
rs.Open s, pCon, , , adCmdText
rs.PageSize = intSize
pTotal = rs.PageCount
If pTotal = 0 Then ''空
pCurrent = 0
Else
If pCurrent = 0 Then pCurrent = 1
rs.AbsolutePage = pCurrent
For lp = 1 To rs.PageSize
If rs.EOF Then Exit For
sKey = CStr(rs(0))
Set m = lv.ListItems.Add(, , sKey)
If Not IsNull(rs(1)) Then m.SubItems(1) = Trim(rs(1))
rs.MoveNext
Next
End If
Set rs = Nothing
End Sub