Timeout expired (#0)

I have a MS Access database that is linked to a MSSQL database through ODBC. The query has a where clause that retrieves records that fall into a date range. If I use a small range, lets say 30 days, the query works fine. If I increase the range to 60, I get the following error:

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

I looked at other questions similar to mine on Experts-Exchange, and some of the suggestions asked to modify the timeout for the ODBC connection. Where would I find this setting? I didn't find anything in the ODBC settings. If there is another suggestion, I'll be glad to also give it a try. I'm using MS Access 2000 on a Windows XP machine. Thanks!
Horalia RodriguezIT DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EMCITCommented:
Tools>Options>Advanced you can set the timeout interval there. This sounds, however, like the query involves a large number of records as the date range expands. I would try increasing the timeout slightly until it works.
GRayLCommented:
Check VB Help (Ctl-G or Alt-F11) - ODBCTimeout Property
GRayLCommented:
You might also want to check Help - QueryTimeout Property
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Horalia RodriguezIT DeveloperAuthor Commented:
EMCIT, I changed the setting as you suggested but I still get the same error. These are my settings:

OLE/DDE timeout (sec): 0
Refresh interval (sec): 60
Number of update retries: 2
ODBC refresh interval (sec): 1500
Update retry interval (msec): 250

GRayL, I read the help section and changed timeout with the following code:

Dim dbsCurrent As Database
Set dbsCurrent = CurrentDb
dbsCurrent.QueryTimeout = 0

and I still get the error.
GRayLCommented:
Try reading:  ODBCTimeout Property Example (MDB)

Remember this is an ODBC connection not a straightforward query.  I only included the latter to give you the bigger picture.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Horalia RodriguezIT DeveloperAuthor Commented:
Worked great. The query takes quite a while to run, but at least it runs! Thanks!
GRayLCommented:
Thanks, glad I could help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.