+ Reply to Thread
Results 1 to 2 of 2

Querytable OLEDB connection

  1. #1
    Registered User
    Join Date
    06-13-2008
    Posts
    12

    Querytable OLEDB connection

    Hi I'm having a problem with creating a querytable via VBA, everything seems to work fine but I always get the initialization details window popup when the connection is actuall made i.e. when the querytable is refreshed.
    The OLE DB initialization window has the correct data source but the other parameters are default or blank, if I click OK it works, or if I edit in the correct details it works... but why wont it just work silently without the popup window? I'm guessing there is something wrong or missing from my connection string.

    This is the code snippet:

    By the way this is coded in Access (hence the appXL Excel object), access creates a spreadsheet then creates the querytable.

    Please Login or Register  to view this content.
    Any help appreciated!

    Also further on I attpemt to delete the connection before closing the workbook but it doesnt seem to work, I havent debuged that yet but any thoughts welcome!

    Please Login or Register  to view this content.
    Edit: I forgot to mention, the data source is the database that this code module is in, so sDatabase contains the value of Application.CurrentDb.Name probably not important...
    Last edited by mrcoffee; 07-25-2011 at 09:27 AM.

  2. #2
    Registered User
    Join Date
    06-13-2008
    Posts
    12

    Re: Querytable OLEDB connection

    OK, I've given up on the OLEDB connection string and am now using ODBC which seems to work fine:

    Please Login or Register  to view this content.
    THough i'd still appreciate if anyone can explain the OLEDB problem.

    Which just leaves the issue of closing the connection, when I try to delete the connection with the code above there is a message on opening the resultant workbook saying that the query table has been discarded due to integrity issues, the workbook also opens up as "Reparied".

    Any ideas what thats about and how to avoid it? The message doesnt come up if I leave the connection in place.

+ 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