A
alex
Querydef Timeout
Hello,
Using Acesss ’03…
I use the following code to create a querydef. It works fine, but
notice the ODBC timeout…when it expires, the query just ends without
causing an error; i.e., I’d like to trap an error so that my users
know if the query timed out or if no records actually exist. Right
now, they cannot determine.
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb 'open pointer to current database
On Error Resume Next
dbs.QueryDefs.Delete ("MyQuery")
Set qdf = dbs.CreateQueryDef("MyQuery", strSQL)
qdf.ODBCTimeout = Me.comTimeOut 'combo box that holds 1-5 min (in sec)
intervals
qdf.Execute 'run query
Debug.Print qdf.RecordsAffected & " records added"
qdf.Close 'clean up
Set qdf = Nothing 'clean up
Set dbs = Nothing
Thanks for your help
alex
Hello,
Using Acesss ’03…
I use the following code to create a querydef. It works fine, but
notice the ODBC timeout…when it expires, the query just ends without
causing an error; i.e., I’d like to trap an error so that my users
know if the query timed out or if no records actually exist. Right
now, they cannot determine.
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Set dbs = CurrentDb 'open pointer to current database
On Error Resume Next
dbs.QueryDefs.Delete ("MyQuery")
Set qdf = dbs.CreateQueryDef("MyQuery", strSQL)
qdf.ODBCTimeout = Me.comTimeOut 'combo box that holds 1-5 min (in sec)
intervals
qdf.Execute 'run query
Debug.Print qdf.RecordsAffected & " records added"
qdf.Close 'clean up
Set qdf = Nothing 'clean up
Set dbs = Nothing
Thanks for your help
alex