If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > CopyFromRecordset Oddity

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-16-08, 08:58
HellBoy HellBoy is offline
Registered User
 
Join Date: Apr 2008
Posts: 2
CopyFromRecordset Oddity

Recently I was using the CopyFromRecordset method (as I have done for years) and I ran into something wierd.

I was programming Excel through Access VBA (late binding). I was using ADODB.Connection, ADODB.Command and an ADODB.Recorset objects. The command object was referencing an SP on the database server and the recordset object was referencing the command.

I have done this a thousand times, however this time when I tried to use the CopyFromRecordset method it would only copy over the first 21 columns.

I know that there are 2 additional parameters (max rows, max columns) to the method other than the recordset itself but providing values for them made no difference.

When I tried looping through the RS any column after the first 21 reported back invalid use of null if referenced, even though when holding my mouse over the field I could see the correct value that it held.

I created a different workaround (albeit a bit more convoluted) so there's not much pressure for a response but I was wondering if anyone else had experienced this and came up with a solution or atleast the reason behind it.

Thanks, db
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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