+ Reply to Thread
Results 1 to 2 of 2

Run-time error '1004': General ODBC Error

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    Washington, United States
    MS-Off Ver
    Excel 2007
    Posts
    21

    Run-time error '1004': General ODBC Error

    Hello,

    I'm trying to automate some reporting that I do for my company and I've created a process with a combination of recorded macros and published code.

    The process begins with a workbook open event that calls each of the sub procedures. Basically the old range/table is deleted and then a new ODBC connection to an Access database that contains a pass through query to my companies data warehouse which returns a set of data to a new query table in excel and then sends an email and closes.

    Sometimes, with one of these processes in particular I get the "Get Run-time error '1004' General ODBC Error" when the code gets to the line ".Refresh BackgroundQuery:=False" in my ConnectDB sub.

    Here is the code:
    Please Login or Register  to view this content.
    I recorded the ConnectDB sub and so I have a feeling that's where the issue is but I'm not sure.

    Does anyone know what I may be doing wrong here?

    Thank you for your help!

  2. #2
    Registered User
    Join Date
    08-23-2012
    Location
    Washington, United States
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: Run-time error '1004': General ODBC Error

    I think the reason this was happening was because I moved buildings on campus and the network is slower in my new location so the ODBC connection was timing out. I changed the ODBC timeout setting in my Access pass-through query to never time out and now it works fine.

+ 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