Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 2003 SP1: CopyFromRecordset error if field above 911 charact

I have a spreadsheet that pulls data from a SQL Server 2000 database using a
stored procedure call (via ADODB.Command.Execute) and the
Range.CopyFromRecordset method. In previous versions of Excel (97 and 2000),
my code works fine. However, we're upgrading to Excel 2003 and this seems to
have problems with any field longer than 911 characters.

One of the fields I pull back is VARCHAR(1000), and in a few cases this is
fully used. If in the stored procedure I wrap this field with Left( ... ,
911) then it works fine, but if I omit the Left() call or use 912 or any
larger number, I get a run time error -2147467259 - "Method CopyFromRecordset
of object Range failed".

Has anyone else encountered this behaviour? Is it a recognised bug with
Excel? (I can't find reference to it in the knowledge base.) Is there a post
SP1 hot-fix or patch that fixes this? For information, the exact build of
Excel that I'm working to is 11.6355.6360.

I've found a previous reported instance on the following URL, but the
discussion petered out before anyone came up with a solution/recommendation.
<http://www.xtremevbtalk.com/showthread.php?mode=hybrid&t=231384

In the short term I'll leave the Left() in the SP to get people working
again, but it'd be nice to show full-length fields if there's a
fix/workaround...

I'd be very grateful for any assistance or further information.

Yours,
Nathan Holmes.

PS: 911 seems like an odd number to fall over on, unless a bored developer
at MS was having a joke at the expense of the [American] emergency services!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Validation starting with 2 char & total less than 8 charact carusso Excel Worksheet Functions 4 January 26th 09 10:51 PM
Cannot update <field name; field not updatable. (Error 3113) Boo Ray Excel Worksheet Functions 0 November 27th 07 01:39 PM
copyfromrecordset fails after upgrade to XP and Excel 2003 [email protected] Excel Programming 0 April 28th 05 06:06 PM
Using a macro to format data: deleted rows with a certain charact stilllearning Excel Programming 1 October 25th 04 05:45 PM
Excel 2003 - 'CopyFromRecordset' Error Chris Wiley Excel Programming 2 October 2nd 04 05:42 AM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"