Tuesday, August 26, 2008

ODBC--call failed. [Microsoft][ODBC SQL Server Driver]Timeout expired (#0)

In Microsoft Access, when you open a pass-through query to a SQL Server 2000 or SQL Server 2005 database, sometimes the query times out. Usually for me this happens when the database is very large.

The error message is:

ODBC--call failed. [Microsoft][ODBC SQL Server Driver]Timeout expired (#0)

You can set the timeout interval for ODBC connections in the registry. It is a setting for the Microsoft JET 4.0 engine, which is the database engine that Access 2003 uses.

(When you create a new ODBC DSN, and see all those drivers listed that are version 4.00 and contained in ODBCJT32.DLL -- those drivers are part of JET and likely came with MDAC.)

The QueryTimeout value lives in the registry at

HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\Engines\ODBC

The default value is 60 seconds. You can increase the timeout setting, or change it to 0 so that queries will never time out.

Follow these steps:

1. Close Access.

2. Start --> Run

3. In the Open field, type regedit and click OK to run the Registry Editor.

4. Expand HKEY_LOCAL_MACHINE. Expand Software. Expand Microsoft.
Continue navigating to Jet\4.0\Engines\ODBC folder.


5. On the right side, double-click the QueryTimeout value to edit it.

6. Under Base, click the Decimal radio button.

7. In the Value data field, enter a new number of seconds. Or, enter 0 to allow unlimited time.


8. Click OK. Exit Registry Editor.

Now you can restart Access and try the query again.

4 comments:

Salman said...

Thank you very much your suggestion turned out to be very helpful.

Anonymous said...

Thanks so much!!
This helped me out also!!
-Nicole

Anonymous said...

If it weren't for this post, I'd be lost. <3 <3 <3

Anonymous said...

Hi Guys,

The alternative way in resolving issue was using DSN SQL Server Native client 10.0

BR,
Olexander