用vb编写个管理软件数据库是excel的用adodc连接,并用DataGrid显示,但是数据库的内容比较多想分页显示,有大大说用top来可是top只能显示前n个,该怎么改,另外页数怎么获得并显示出来啊(就是比如100条数据10条一个,在列表下方出现1 2 3 4 5 6 7 8 9 10),这是数据库连接的东东。谢谢帮忙了
Private Sub Command1_Click()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\soft\vb\excel\nw.xls;Mode=ReadWrite;Extended Properties=excel 8.0;Persist Security Info=False"
Adodc1.RecordSource = "select top 10 * from [nw1$] "
Adodc1.Refresh
'DataGrid1.RefreshEnd Sub
Private Sub Command1_Click()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\soft\vb\excel\nw.xls;Mode=ReadWrite;Extended Properties=excel 8.0;Persist Security Info=False"
Adodc1.RecordSource = "select top 10 * from [nw1$] "
Adodc1.Refresh
'DataGrid1.RefreshEnd Sub
if not adoPrimaryRS.EOf then
objrs.AddNew objrs!id = adoPrimaryRS!id objrs!anumber = adoPrimaryRS!anumber adoPrimaryRS.MoveNext
end if
Next '绑定 Set DataGrid1.DataSource = objrs '显示页数 txtPage = lPage & "/" & adoPrimaryRS.PageCount End Sub Private Sub Form_Unload(Cancel As Integer) If Not conn Is Nothing Then conn.Close End If Set conn = Nothing End Sub