BUG: NextRecordset Fails on Remoted or Disconnected RecordsID: Q189948
|
When you call the NextRecordset method on a remoted or disconnected recordset, the following error message appears:
The operation requested by the application is not supported by the provider.Run-time error: '3251':
If you are using RDS there is no known workaround. Refer to the MORE INFORMATION section for information on command_click1. If you are using an ADO code, do not set the active connection to nothing (that is, do not disconnect the recordset). Refer to the MORE INFORMATION section for information on command_click2.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
Private Sub Command1_Click()
Dim ds As Object 'RDS.DataSpace.
Dim df As Object 'RDSServer.DataFactory.
Dim oRsCompound As adodb.Recordset 'Resultset.
Dim iCount As Integer ' Open compound recordset.
Dim sCn As String
Dim sSQL As String
sCn = "Provider=MSDASQL;dsn=localserver;uid=sa;pwd=;database=pubs"
sSQL = "SELECT * FROM authors; " & _
"SELECT * FROM stores; " & _
"SELECT * FROM jobs"
Set ds = CreateObject("RDS.DataSpace")
Set df = ds.CreateObject("RDSServer.DataFactory","http://localhost")
Set oRsCompound = df.Query(sCn, sSQL)
Do Until oRsCompound Is Nothing
Debug.Print "Contents of recordset #" & iCount
Do While Not oRsCompound.EOF
Debug.Print , oRsCompound.Fields(0), oRsCompound.Fields(1)
oRsCompound.MoveNext
Loop
Set oRsCompound = oRsCompound.NextRecordset
iCount = iCount + 1
Loop
End Sub
Private Sub Command2_Click()
Dim oRsCompound As adodb.Recordset
Dim iCount As Integer ' Open compound recordset.
Dim sCn As String
Dim sSQL As String
sCn = "Provider=SQLSQLOLDB;" & _
"Data Source=servername;" & _
"Initial Catalog=pubs;" & _
"User Id=sa;Password=;"
sSQL = "SELECT * FROM authors; " & _
"SELECT * FROM stores; " & _
"SELECT * FROM jobs"
Set oRsCompound = New adodb.Recordset
oRsCompound.CursorLocation = adUseClient
oRsCompound.Open sSQL, _
sCn, _
adOpenUnspecified, _
adLockUnspecified
'If next line is commented out it works.
Set oRsCompound.ActiveConnection = Nothing
Do Until oRsCompound Is Nothing
Debug.Print "Contents of recordset #" & iCount
Do While Not oRsCompound.EOF
Debug.Print , oRsCompound.Fields(0), _
oRsCompound.Fields(1)
oRsCompound.MoveNext
Loop
Set oRsCompound = oRsCompound.NextRecordset
iCount = iCount + 1
Loop
End Sub
Additional query words:
Keywords : kbADO150bug kbADO200bug kbDatabase kbRDS kbRDS150bug kbRDS200bug kbVBp600
Version : WINDOWS:1.5,2.0
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: August 5, 1999