ODBC Timeout in RunSQL

  • Thread starter intersection row and column
  • Start date
I

intersection row and column

I ran a query in VBA Access with :
DoCmd.RunSQL strSQL
I got an error message, something like "ODBC Timeout ...".
How can I fix the problem ?
Thx
 
G

GregB

I ran a query in VBA Access with :
DoCmd.RunSQL strSQL
I got an error message, something like "ODBC Timeout ...".
How can I fix the problem ?
Thx

It could be the issue of an inefficient query. Did you try to use a
'Debug.Print' statement to isolate the query (and viewing it via the
immediate window) such as

Debug.Print strSQL

From there, put the query into the query editor and see if it runs
well or if it times out in that context also. Feel free to post the
query itself here as that can help folks help you.

Regards,
GB
 
I

intersection row and column

I ran the program a second time and this time there was no error message.
strange ...
Thanks for the tip anyway.
 
C

colfusa

I have the same question, but permit me to restate it: How can you set the
"ODBCTimeout" property to something other than the default 60 seconds when
using the "DoCmd.RunSQL" command?

I found one work-around that I don't like very much. You can create a query
using your sql code, then use the following code to change the "ODBCTimeout"
property for the query:

Sub ODBC_Timeout()

Dim db_Q As QueryDef

Set db_Q = CurrentDb.QueryDefs("Query1")
db_Q.ODBCTimeout = 0
db_Q.Close

End Sub

colfusa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top