ODBC timeout (1 Viewer)

nileshtx

New member
Local time
Today, 16:05
Joined
Apr 3, 2002
Messages
9
I have this code in a module that keeps timeing out after 60 seconds is there a way to make it run for at least 10 minutes.

Dim db As Database
Dim strSQL As String

Set db = CurrentDb
strSQL = "INSERT INTO Daily_Trends_All SELECT Master.* FROM Master WHERE (((Master.filtered)=0) AND ((Master.biz_date)=#" & strDate & "#));"
db.QueryTimeout = 0
db.Execute (strSQL)

Thank you,
nilesh
 

madhouse

Registered User.
Local time
Today, 16:05
Joined
Jul 3, 2002
Messages
65
You need to set the QueryTimeout before the the strSQl, so try putting db.QueryTimeout = 6000 (which is equal to 10 minutes) on the next line after Set db = CurrentDB e.g.

Set db = CurrentDB
db.QueryTimeout = 6000

strSQL = "INSERT INTO Daily_Trends_All SELECT Master.* FROM Master WHERE (((Master.filtered)=0) AND ((Master.biz_date)=#" & strDate & "#));"
db.Execute (strSQL)
 

nileshtx

New member
Local time
Today, 16:05
Joined
Apr 3, 2002
Messages
9
Ihave tried "db.QueryTimeout = 6000" but it times out after 60 seconds
 

DW

Registered User.
Local time
Today, 16:05
Joined
May 25, 2002
Messages
58
I may be wrong but I thought Access records seconds as hundredth's.

So if 6000 = sixty seconds, try adding a couple of noughts 600000

Try and see.

Dave
 

nileshtx

New member
Local time
Today, 16:05
Joined
Apr 3, 2002
Messages
9
i get overflow error message when i try to use "db.QueryTimeout = 600000"
 

DW

Registered User.
Local time
Today, 16:05
Joined
May 25, 2002
Messages
58
Sorry it didn't work, Ive never used a time-out function.

Perhaps one of the more experienced members can help.

Regards
Dave
 

Users who are viewing this thread

Top Bottom