Results 1 to 3 of 3

Thread: anybody would help me about loop to excel?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    3

    anybody would help me about loop to excel?

    i have a database name database and the name of table is tblsample..
    now, i used loop to retrieve the data from database and the output of loop
    will come out to msexcel....but i cant get the output i want.instead, the last
    record from the database table will always comeout in cell A1.. please help me, if you want to see the code im willing to provide

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: anybody would help me about loop to excel?

    The easiest way to put data from a database into Excel is to use the CopyFromRecordset method.

    For an example & explanation, see the Excel Tutorial link in my signature.

  3. #3
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: anybody would help me about loop to excel?

    Quote Originally Posted by reden
    .... the last record from the database table will always comeout in cell A1..
    This was probably caused by you not incrementing to the NEXT cell for each record retrieved. The end result, is the last record being displayed - if you could slow the clock,
    you would probably see each returned record appear in that one cell (A1).

    You would need to post your code block to be certain

    Si_the_geek posted an alternate to looping.

Posting Permissions

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



Click Here to Expand Forum to Full Width