NextRecordset
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset Cmd.ActiveConnection = "DSN=MySamples;UID=sa"
Cmd.CommandText = "MyNextProc"
Cmd.CommandType = adCmdStoredProcSet rs = Cmd.Execute()
While Not rs Is Nothing
If (Not rs.EOF) Then
Debug.Print rs(0)
End If
Set rs = rs.NextRecordset()
Wend
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset Cmd.ActiveConnection = "DSN=MySamples;UID=sa"
Cmd.CommandText = "MyNextProc"
Cmd.CommandType = adCmdStoredProcSet rs = Cmd.Execute()
While Not rs Is Nothing
If (Not rs.EOF) Then
Debug.Print rs(0)
End If
Set rs = rs.NextRecordset()
Wend
然后select xx from #temptable就行了,当然#temptable要设计成能容纳所有字段的结构
这样做有一个坏处,很占资源