sql - Access - Requery quits after 60 seconds -


i have subform in access that's using query definition executing stored procedure (on sql server) record source, purpose of search. user types in identifier, access modifies query definition (exec [procname] [identifier]), requeries subform, , should populate subform results of procedure.

problem is, if after 60 seconds if nothing's come back, gives in. no errors, no timeout alert, no warnings. gives every impression it's received empty result set. stepping through code confirms - hangs around on subform.requery line 60 seconds (i've timed it) , goes "well that's quite enough of that" , moves on without alerting issue. there no error handling in sub (no dodgy on error resume next or - if there's problem @ all, should bomb).

i've copied query definition straight out of debugger whilst stepping through code , fired in sql server management studio, , work. takes longer 60 seconds.

why access throwing in towel after 60 seconds? , how can force wait longer?

open query in design view. under view menu, select properties.

when "query properties" window appears, set "odbc timeout" property 0.

by default, set 60, means query timeout after 60 seconds. changing odbc timeout value 0, access never timeout.

this property specific query working on. if have problems other queries, need repeat same steps on each of queries.

you can set in code using (you can pare down 1 or 2 lines need...:

    sub odbctimeoutx()    dim dbscurrent database   dim qdfstores querydef   dim rststores recordset    set dbscurrent = opendatabase("northwind.mdb")    ' change default querytimeout of northwind   ' database.   debug.print "default querytimeout of database: " & _   dbscurrent.querytimeout   dbscurrent.querytimeout = 30   debug.print "new querytimeout of database: " & _   dbscurrent.querytimeout    ' create new querydef object.   set qdfstores = dbscurrent.createquerydef("stores", _   "select * stores")    ' note: dsn referenced below must configured   ' use microsoft windows nt authentication mode   ' authorize user access sql server.   qdfstores.connect = _   "odbc;database=pubs;dsn=publishers"    ' change odbctimeout setting of new querydef   ' object default setting.   debug.print "default odbctimeout of querydef: " & _   qdfstores.odbctimeout   qdfstores.odbctimeout = 0   debug.print "new odbctimeout of querydef: " & _   qdfstores.odbctimeout    ' execute query , display results.   set rststores = qdfstores.openrecordset()    debug.print "contents of recordset:"   rststores   while not .eof   debug.print , .fields(0), .fields(1)   .movenext   loop   .close   end    ' delete new querydef because demonstration.   dbscurrent.querydefs.delete qdfstores.name   dbscurrent.close   end sub  

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -