Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server ASP
|
SQL Server ASP Discussions about ASP programming with Microsoft's SQL Server. For more ASP forums, see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server ASP 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:44 AM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default copyFromRecordset error Excel macro

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)
   [u]Call Sheet4.Range("A2").CopyFromRecordset(zRecordset)</u>
   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 using ADO maaron Excel VBA 0 August 11th, 2006 08:52 AM
VBA CopyFromRecordset and Excel JWag Pro VB Databases 0 April 12th, 2005 09:03 AM
Error in Excel macro after going from NT to XP Kendenny Excel VBA 7 April 1st, 2004 11:41 AM





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