m.lcOnError = on("error") m.llhadSQLerror = .f. on error m.llhadSQLerror = .t. *!* do SQLEXEC if m.llhadSQLerror *!* Error occurred with SQLEXEC() endif on error &lcOnError>connection is made at start of application. But status of connection needs to be tested before each sqlexec(). App could be running for along time and lose connection. Then SQLexec() could fail. The idea is to test the connection before issuing SQLexex()