Howdy all.
I'm fairly experenced with
VB, but new to VBA and using ADO objects.
My problem is that im querying a webservice that returns ADO objects, and my queries work fine when they return about 10 or fewer rows. When they get larger, however, my open commands return the follwing messge:
Run-time error '-2147467259 (800004005)':
Data provider or other service returned an E_FAIL status.
My guess is that this is because its taking too long for the web service to return a result (although the error is nearly instantanious) or that the ado object is unable to hold the data for some reason. I think what I'm doing is pretty straight forward, so I'm hoping that the answer is obvious to those more in the know than I. The problem part of the code is as follows, and it dies on the 2nd to last line with the copyfromrecordset. Any ideas?
Dim RS As ADODB.Recordset
Set RS = New ADODB.Recordset
Dim getobjectscmd as string
url = <the url>
RS.Open getobjectscmd
Dim I As Integer
For I = 1 To RS.Fields.Count
Application.ActiveSheet.Cells(1, I).Value = RS.Fields(I - 1).Name
Next
Application.ActiveSheet.Cells(2, 1).CopyFromRecordset RS 'Problem here
RS.close