Errors Solutions
error

I am using Access 2003 and writing a DCount function on a linked SQL table, I continually get 'Timeout Error'?

Q: I am using the following VBA decree:
Myval1 = DCount("*", "[aaMasterProjectData]")

After about 60 seconds I get the following:
Runtime "3146" ODBC Failed Timeout Expired

Does anyone separate how to prevent this from happening?
I am aware that you can edit the properties of a query and change the ODBC Timeout, but I'm not using a question, just VBA in modules, so I'm looking for some sort of VBA command that will do the same as the ODBC Timeout in the query properties.


A: yes, by lapse the timeout is set to 60 seconds for remote databases. in query design, bring up the properties window (put click on the query design window, or choose from the view menu) you'll see a timeout of 60. set to a let out number. zero will disable timeout.

also, if a query takes more than 60 seconds, look to update the query. see if you can use a regular count (or correlated sub query) that can execute on the remoteserver, instead of dcount vba purpose.

© 2008 Errors Solutions