... * test SQL Connection if sqlexec(lnConnectionHandle, []) >=0 * Everything is fine else * now check aError aerror(laError) if m.laError[1,1] = 1526 * It is an SQL Connection error, now a look at the 5. Column can give us Details do case case laError[1,5] = 229 * Connection error! * Now first you have do make all sql Handles idle asqlhandles(laSqlhndls) for each m.lnOdbchdbc IN m.laSqlhndls foxobject sqlIdleDisconnect(m.lnOdbchdbc) endfor * And now, try again to check the SQL Connection if sqlexec(lnConnectionHandle, []) >=0 * Everything is fine else * now check aError again.... --> Ok, you have to put everything in a Loop, an we show the User a Message "Connetion is broken, wait until it workes again"... aso. case inlist(laError[1,5], 1205, 1222) * Deadlock or Lock occured, you have to Deal with it... endcase endif endifThis also works with remoteviews. You only have to place your connectionCheck Code before requery/use RemoteView...