Results 1 to 3 of 3
  1. #1
    tomlesniak is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    2

    Rrefresh query in Excel without Access installed

    Hi All,
    I have Access in my corpo and so I have made in Excel query in workboock with ODBC;DSN=MS Access Database;DBQ=C:\TL\OBLICZENIA.accdb;DefaultDir=C:\ TL;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5; and when i try to refresh it at home I have an error that database engine can not find destination query (sorry if I translate it wronge, I get this in PL language). What can be the reason of it? I tried also vba method but then i have info Run-time error '1004'. Below vba code I use :
    Code:
    Sub dwa()
     
    sqlstring = "select * from ZALEGACZE"
    connstring = "ODBC;DSN=MS Access Database;DBQ=C:\TL\OBLICZENIA.accdb;Driver={Microsoft Access Driver (*.mdb, *.accdb)}"
    'MsgBox (connstring)
    With ActiveSheet.QueryTables.Add(Connection:=connstring, _
            Destination:=ActiveSheet.Range("A3"), Sql:=sqlstring)
        .SaveData = False
        .FieldNames = True
        .Name = "Contact List"
        .FieldNames = True
        .RowNumbers = False
        .FillAdjacentFormulas = False
        .PreserveFormatting = True
        .RefreshOnFileOpen = False
        .BackgroundQuery = True
        .RefreshStyle = xlInsertDeleteCells
        .SavePassword = True
        .SaveData = False
        .AdjustColumnWidth = True
        .RefreshPeriod = 0
        .PreserveColumnInfo = True
        .Refresh BackgroundQuery:=False
    End With
     
    End Sub
    I did this several years ago with access 2003, ofcourse with different driver, and it worked.
    Please help.
    TomL

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Does your PC at home have the Access ODBC driver installed?
    if so, what version?

  3. #3
    tomlesniak is offline Novice
    Windows 10 Access 2016
    Join Date
    May 2017
    Posts
    2
    Thanks ranman256! Okham's razor as always. There was MS ODBC driver in system ODBC data sources (tranlation from PL) but looking carefully I've noticed notation "not available, only to remove" (tranlation) so I've downloaded x64 driver, installed and done!!! Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-28-2015, 07:54 AM
  2. Replies: 2
    Last Post: 01-08-2014, 08:52 AM
  3. Replies: 7
    Last Post: 02-10-2012, 02:48 PM
  4. Send Form without Access installed
    By Daniela in forum Forms
    Replies: 3
    Last Post: 02-07-2012, 07:07 AM
  5. Access Installed? How to check it online.
    By Thopaga in forum Access
    Replies: 2
    Last Post: 12-09-2010, 02:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums