Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    144

    Unanswered: Populating a table from an ADO Recordset

    Hello

    I want to create an Access macro that given an opened ADO Recordset, it would use it in order to populate a table. Which is the most efficient way to do so?

    Thanks a lot.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    The most efficient thing would likely be not to do it that way. Is there a really good, unavoidable reason you are using a recordset?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2003
    Posts
    144
    This is because I am loading data from an Oracle database using ADO and I want to place that data into an Access table.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    It is a direct transfer? You aren't doing any complex data alterations?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Mar 2003
    Posts
    144
    a direct transfer.

  6. #6
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Ok - this is best done as a set based process. A recordset deals with records on a one by one basis. So you would insert one row at a time. If we do this in a set based process, we can do it in one action. You can liken this to sugaring your tea one grain at a time, or with a sugar cube.

    There are several ways to achieve this. Easiest would be to link to the Oracle table - you can then use this like you would use any table. The code now becomes:
    Code:
    INSERT INTO myAccessTable (col12, col2)
    SELECT col1, col2
    FROM myLinkedOracleTable
    Sound like a plan?
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

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