|
在一些特殊的运算,Recordset 经运算后的到一个全新的Recordset。
如下面简单例子。
请教?如何将Recordset 转化为 Table?供报表打印使用
Private Sub Command0_Click()
Dim rs As New ADODB.Recordset
Dim bmk(10)
rs.CursorLocation = adUseClient
rs.ActiveConnection = "rovider=sqloledb;" & _
"Data Source=ServerName;Initial Catalog= pubs;User Id=saassword=PWD;"
rs.Open "select * from authors", , adOpenStatic, adLockBatchOptimistic
Debug.Print "Number of records before filtering: ", rs.RecordCount
ii = 0
While rs.EOF <> True And ii < 11
bmk(ii) = rs.Bookmark
ii = ii + 1
rs.Move 2
Wend
rs.Filter = bmk
Debug.Print "Number of records after filtering: ", rs.RecordCount
rs.MoveFirst
While rs.EOF <> True
Debug.Print rs.AbsolutePosition, rs("au_lname")
rs.MoveNext
Wend
End Sub
|
|