|
Custom Search
| |
|
How to Change Query Timeout Value for MS Access SQL Queries
By default, query timeout value in MS Access is 60 seconds. This value can be changed at three different levels. Each level is effective for a specific scope of queries. You may have experienced Microsoft Access query timeout. This often happens to
1. Change query timeout for a pre-built query. Quite a few types of queries can be pre-built in Access in query Design View or hand-code SQL in SQL view. After a query is created, a default query timeout value (60 seconds) is assigned to the query. To change this value, we use Northwind database as the example. Follow these steps:
2. Change query timeout for raw SQL queries embedded in VBA code. Sometimes, you write raw SQL queries in VBA code and you want to control timeout value for a specific query or a bunch of queries. You can do it in code editor by using either ADO or DAO Database object. For ADO, use this code to change timeout value:
Dim objDB as Database
Set objDB = CurrentDB objDB.QueryTimeout = 120 For DAO, use this code to change timeout value:
Dim objDB As DAO.Database
Set objDB = CurrentDb() objDB.QueryTimeout = 120 Note that, the timeout value changed here is only effective to hard-coded SQLs in VBA. If you call a pre-built query by VBA, the timeout value set in the query's properties window takes precedence. 3. Change query timeout value in Registry. For raw SQL hard-coded in VBA or SQL coded in Access form control properties, if you don't specify a timeout value by using Database object, the value in Registry will be used. To change query timeout value in Registry, follow these steps:
Note that, if the QueryTimeout change in Registry is made while Microsoft Access is running, you must close and then re-open your Microsoft Access database before the change takes effect. Also note that, the timeout value set in the properties of a re-built query takes precedence over the registry value. |
Copyright © 2024 GeeksEngine.com. All Rights Reserved. This website is hosted by HostGator. No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it. |
Home | Feedback | Terms of Use | Privacy Policy |