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 October 11th, 2007, 09:16 PM
wuy wuy is offline
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default runtime error when copyfromrecordset

when i try to use CopyFromRecordset to export data to excel ,
it generate runtime error '-2147467259(800004005)':
Automation Error
Unspecified Error
but when I add conditions in sql as red marked to smaller the sql result to several records , it works well.

what caused this and how can i solve it ?? thanks!

Set ConnSet.ActiveConnection = Conn

ConnQuery = "SELECT product,facility FROM DWH_FAB300.DWH_PRODUCT where product='111111' "

Set ConnSet = Conn.Execute(ConnQuery, RowsAffected, CommandTypeEnum.adCmdText)
Call Sheets("product").Range("A1").CopyFromRecordset(Co nnSet)







Similar Threads
Thread Thread Starter Forum Replies Last Post
hi i got runtime error 13 Type Mismatch error sriharsha345 Access VBA 2 February 21st, 2008 09:30 AM
CopyFromRecordset Error maaron SQL Server ASP 1 April 17th, 2007 10:26 AM
Copyfromrecordset error using ADO maaron Excel VBA 0 August 11th, 2006 08:52 AM
copyFromRecordset error Excel macro maaron SQL Server ASP 0 August 11th, 2006 08:44 AM
CopyFromRecordset to Spreadsheet rweide SQL Server ASP 2 October 14th, 2004 03:56 PM





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