+ Reply to Thread
Results 1 to 1 of 1

Excel VBA makes ODBC connection to Access-How do you close the connection?

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Excel VBA makes ODBC connection to Access-How do you close the connection?

    Hello and thank you for your time, I scraped together some VBA code that imports several Access tables into Excel. The code works perfectly, it loads 12 worksheets with the contents of 12 tables. It does not matter if the MDB is open or closed, the code works either way (nice!). After I run the code, the MDB opens in read only mode. If I close the Excel workbook (which is host to the macro) then the MDB opens normally. Here's my question: How can I close the ODBC link (with VBA) without closing the Excel workbook? Below is an except of the code I scraped together with the help of the macro recorder (code between EZ3) and code that a co workhed provided (see code between EZ2).

    Any help would be greatly appreciated. Below is an except of code used to establish ODBC connection and to load a worksheet.

    Please Login or Register  to view this content.
    Last edited by MrHockey; 05-04-2010 at 06:36 PM.

+ 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