+ Reply to Thread
Results 1 to 17 of 17

Leave OLEDB connection open

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: Leave OLEDB connection open

    Which line threw the error?

  2. #2
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: Leave OLEDB connection open

    It doesn't look like the maintain connection property is available when creating connection through ADODB. Since you are using conn.Open to open, I assume you are closing with conn.Close. If that is true, I think you can just delete the conn.Close. Note, though, that in general, it's a very bad idea to maintain an open connection to a database. It sucks resources on both ends and offers way more opportunity for corruption and concurrency issues. I know sometimes you just gotta do what you just gotta do, but, if there is any other alternative, like storing a local copy on a worksheet, processing as needed, then reopening connection when you're actually ready to use it. Not sure what your exact situation is, but you may want to give this some more thought.

  3. #3
    Registered User
    Join Date
    08-06-2012
    Location
    Indianapolis, IN
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Leave OLEDB connection open

    What you say makes sense. So then, is there a way to store the user id and password while the file is open so I can create the connection when I want to perform the query and not need to ask for the password each time?
    "OK, this should work......"
    "#!@*"

  4. #4
    Forum Contributor
    Join Date
    02-15-2010
    Location
    Everett, WA
    MS-Off Ver
    All versions; most components
    Posts
    188

    Re: Leave OLEDB connection open

    And, again, you may find the connection manipulation much easier if you create WorkbookConnections as mentioned above.

+ 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