Closed Thread
Results 1 to 2 of 2

VBA Refresh ODBC Connection with too Many Line Continuations

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    Washington, DC
    MS-Off Ver
    2013
    Posts
    6

    VBA Refresh ODBC Connection with too Many Line Continuations

    I have a large data file that is refreshed twice a week using an ODBC connection to two separate tables in a data warehouse. Each of the SQL command text are over 800 lines long. About 400 lines in each of the command text needs to be updated each time the data is refreshed. I am looking for a VBA code that will

    1. Replace the the section of the code that needs to be updated
    2. Break the command text into strings of no more than 24 lines to avoid the too many line continuations error.
    3. Copy the command text into each of the ODBC connections.

    From my research so far, my idea is to use a loop to insert a blank line every 20 rows and set each group of 20 rows as a string. So row 20 would equal "str=", row 40 would equal "str = str &" etc.

    The attached file has a sample of one of the command text. The list of variables in column H is the section of code that needs to be update each time the data is refreshed. When I do this manually, I have to copy the command text into a text file before copying it into the ODBC connection, I'm not sure if this step can be skipped via VBA.

    Than you for the assistance!
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: VBA Refresh ODBC Connection with too Many Line Continuations

    This question has been re-posted to Commercial Services.

    Thread closed.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. refresh odbc connection when workbook opens
    By jprlimey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-30-2014, 08:30 AM
  2. Showing ODBC Serve Connection Name on UserForm and refresh
    By BigDaddy0 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2014, 12:13 PM
  3. [SOLVED] Use ODBC connection without setting it up in ODBC administration
    By ExcelGal in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2012, 09:59 AM
  4. Check ODBC connection before refresh
    By sanketgroup in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2010, 07:36 AM
  5. Excel VBA makes ODBC connection to Access-How do you close the connection?
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2010, 06:29 PM

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