How to return multiple recordsets in a single execution using ADODB?

你。 提交于 2019-12-01 08:12:04
jonno

Set the CursorLocation to adUseServer (instead of 'client side' )

Set RS = New ADODB.Recordset
strSQL = "Select * from States; Select * from Countries;"

With RS
   .CursorLocation = adUseServer
   .ActiveConnection = DB_CONNECTION
   .CursorType = adOpenStatic
   .Open strSQL
End With

Do
   If Not RS.EOF Then
       'do something
   End If
   Set RS = RS.NextRecordset
   If RS Is Nothing Then
       Exit Do
   End If
Loop Until RS.State = adStateClosed
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!