+ Reply to Thread
Results 1 to 3 of 3

Preserving data on ODBC refresh

  1. #1
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Preserving data on ODBC refresh

    Hi,
    I download a table from SAGE accounts package using an ODBC link and MSQuery.
    I have a series of additional columns in which I manipulate the linked data in various ways.
    At some later time I need to refresh the link. Typicaly this will add some new data, relink some existing data and some of the existing data will no longer meet the criteria of the Query and will "drop off". I need to preserve the manipulation of the retained "old" data and have some flag to tell the program that the "new" data needs to be manipulated.

    An initial download brings about 300 records. Each refresh adds about 30 and drops off about 30 records.
    I thought that this would be easy, but the refresh seems to destroy the row and column relationships so I get spurious results.
    can anyone help me with this please?
    John Southern

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

    Re: Preserving data on ODBC refresh

    You could use the QueryTable BeforeRefresh and/or AfterRefresh events, with the QueryTable ResultRange Property to copy data to another sheet.

    See the Excel help topics:

    • QueryTable Object Events
    • Using Events with the QueryTable Object

    Also look at these threads for examples of using QT events.

    http://www.excelforum.com/excel-prog...xcel-data.html

    http://www.excelforum.com/excel-prog...-web-data.html

  3. #3
    Forum Contributor
    Join Date
    03-30-2010
    Location
    Manchester England
    MS-Off Ver
    Excel 2010
    Posts
    992

    Re: Preserving data on ODBC refresh

    T-J
    Thanks for your reply. Ive had a look at your suggestions. They seem a bit above my pay grade but I will try them out today and see how far I can get.
    John

+ 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