errormsg and close application when unable to connect to AppDB