?
Solved

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

Posted on 2006-04-07
5
Medium Priority
?
903 Views
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)



0
Comment
Question by:dan5460
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

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

Author Comment

by:dan5460
ID: 16405373
The table that I am trying to export to excel has about 450 records.  

After a while, about 1 minutes.

Thanks

Danny
0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 750 total points
ID: 16405897
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
0
 

Author Comment

by:dan5460
ID: 16544398
Sorry for the delay, problem was resolved.  Your last comment helped

Thanks
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 16544439
No probs.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

850 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