ODBC Call Failed Timeout Expired when transferring a spreadsheet to SQL Server

Posted on 2006-04-07
Last Modified: 2012-05-05
Hello Expert,
For some reason I am getting an error when trying to run a transferspreadsheet function in Access (FE).  I have an Access ADP project connected to a SQL Server 8.  I am using Access as the Front end.  I have a VBA code that transfers a table to an Excel file.  After a little while I get an error message
Run time error 3144
ODBC - Call Failed
Timeout expired (0)

Here is part of the code
Public Sub send2excel()

Dim strFolderName As String
Dim strFileName As String
Dim strbase As String
Dim Response As Variant
Dim objExcel As Excel.Application
Dim wb As Excel.Workbook
Dim ws As Excel.Worksheet

Set objExcel = New Excel.Application
strbase = "basecon_"
strFolderName = BrowseFolder("What Folder you want to Export?")

Response = InputBox("Enter Report as of date ex.YYYYMMDD format")

MsgBox strFolderName & "\" & strbase & Response

xlsf = strFolderName & "\" & strbase & Response

'Export the table to Excel
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "dbo.BASECON_USD", xlsf, True

'Open the Excel spreadsheet and set up the Variable
Set wb = objExcel.Workbooks.Open(xlsf)
objExcel.Visible = True

'Get a reference to the first worksheet.
Set ws = wb.Worksheets(1)

Question by:dan5460
    LVL 44

    Expert Comment

    by:Leigh Purvis
    After a while?
    How many records are we talking about in this table?

    Author Comment

    The table that I am trying to export to excel has about 450 records.  

    After a while, about 1 minutes.


    LVL 44

    Accepted Solution

    Not many then.

    Just a couple of things though.
    There's no need to be creating your Excel application instance at the start of your procedure when you don't use it until the end.
    Do it all together later on - after the export.
    And of course - make sure they're all tidied up afterwards.

    You could try an alternative export method too - just to see if it makes any difference.  Like
    docmd.OutputTo acOutputTable, "dbo.BASECON_USD", acformatxls, xlsf, false

    Author Comment

    Sorry for the delay, problem was resolved.  Your last comment helped

    LVL 44

    Expert Comment

    by:Leigh Purvis
    No probs.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now