Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2004, 11:16 AM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADO object failure for larger querys

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






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with running different querys JAdkins Classic ASP Databases 1 November 27th, 2007 01:58 PM
reusing querys jc188 Beginning PHP 3 April 1st, 2006 02:28 AM
Ouptut from object Recordset (ADO) AnneOlga Excel VBA 1 March 30th, 2006 06:17 AM
GetThumbnailImage produces a larger file jacob C# 3 November 13th, 2005 01:45 PM
ADO Stream/CopyRecord failure ken1 BOOK: Beginning ASP 3.0 4 July 18th, 2004 12:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.