+ Reply to Thread
Results 1 to 5 of 5

Adodb recordset object, columns and rows transposed

  1. #1
    Registered User
    Join Date
    02-27-2007
    Posts
    38

    Adodb recordset object, columns and rows transposed

    Hi All,

    I'm using an ADODB connectino from excel 2007 vba to an oracle database to query data from teh database and return it to my workbook.

    Everything is working excep the final step in which I take the rows from the adodb recordset object and put them into my workbook.

    in this code is the adodb recordset

    Please Login or Register  to view this content.
    It works, but it is transposing the columns and rows. So if I were looking at my query results in my oracle sql editor I'd be seeing rows but the same information is put into columns in the excel workbook by the vba.

    Is it possible to get it to flip things back around without writing some kind of double nested loop thing to transpose the array?

    Thanks,

    Dave
    Last edited by DaveF; 06-21-2010 at 09:21 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: help with adodb recordset object, columns and rows transposed

    Have you tried Transposing the recordset when applying to the Variant Array ?

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 06-18-2010 at 05:39 PM. Reason: removed note: re resize

  3. #3
    Registered User
    Join Date
    02-27-2007
    Posts
    38

    Re: help with adodb recordset object, columns and rows transposed

    Quote Originally Posted by DonkeyOte View Post
    Have you tried Transposing the recordset when applying to the Variant Array ?

    Please Login or Register  to view this content.

    Yeah, I get an error that says "type mismatch".

  4. #4
    Valued Forum Contributor
    Join Date
    08-26-2006
    Location
    -
    MS-Off Ver
    2010
    Posts
    388

    Re: Adodb recordset object, columns and rows transposed

    Use CopyFromRecordset
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-27-2007
    Posts
    38

    Re: Adodb recordset object, columns and rows transposed

    Quote Originally Posted by T-J View Post
    Use CopyFromRecordset
    Please Login or Register  to view this content.
    Perfect. That let me get rid of the transposing. Thank you!!!
    Last edited by DaveF; 06-21-2010 at 09:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1