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 August 11th, 2006, 08:52 AM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copyfromrecordset error using ADO

While pulling data from MS SQL and dumping it to a worksheet using the following code. It has worked until the ActnPlanDesc field (description field) exceeds 900 char. My question is is there indeed a 900 char limit with ADO or do I have something missing in my SQL statment?
zConnectionString = _
"Provider=SQLOLEDB.1;Password=xxxxxx;Persist Security Info=True;" + _
"User ID=xxxxxx;Initial Catalog=xxxxxxxx;Data Source=xxxxxxxx;"

    zSQL = "select DISTINCT ProcBusCycle,CntrlName,ActnPlanName,ActnPlanDocTit le,ActnPlanDesc,ActnPlanCriticality,ActnPlanSteps, ActnPlanStatus,ActnPlanDueDate,ActnPlanResponse,Cn trlDesc,CntrlFrequency,CntrlType2 from ObjSrchTypViewActPlnProcRskMatCntrls Where OrgUnitName LIKE '%Intel%'AND ProcBusCycle NOT LIKE ('%Information%')"
    Set zConnection = New ADODB.Connection
    zConnection.ConnectionString = zConnectionString
    zConnection.Open
    Set zRecordset = New ADODB.Recordset
    zRecordset.CursorLocation = CursorLocationEnum.adUseClient
    zRecordset.CursorType = CursorTypeEnum.adOpenStatic
    zRecordset.LockType = LockTypeEnum.adLockBatchOptimistic
    Call zRecordset.Open(zSQL, zConnection, , , CommandTypeEnum.adCmdText)
   Call Sheet4.Range("A2").CopyFromRecordset(zRecordset)
   Set zRecordset.ActiveConnection = Nothing
   Set zConnection = Nothing











Similar Threads
Thread Thread Starter Forum Replies Last Post
runtime error when copyfromrecordset wuy Excel VBA 0 October 11th, 2007 09:16 PM
CopyFromRecordset Error maaron SQL Server ASP 1 April 17th, 2007 10:26 AM
copyFromRecordset error Excel macro maaron SQL Server ASP 0 August 11th, 2006 08:44 AM
CopyFromRecordset and ADO.NextRecord chrislepingwell Excel VBA 3 March 28th, 2005 11:50 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.