Database::~Database() { if (dbId_ != JET_dbidNil) { const JET_ERR jetErr = JetCloseDatabase(sesId_, dbId_, 0); JET_ASSERT(jetErr, "JetCloseDatabase"); dbId_ = JET_dbidNil; sesId_ = JET_sesidNil; } }
HRESULT Database::Close() { const JET_ERR jetErr = JetCloseDatabase(sesId_, dbId_, 0); if (jetErr != JET_errSuccess) { SetLastErrorDesc(Error("JetCloseDatabase", jetErr, __FUNCTION__)); return E_FAIL; } dbId_ = JET_dbidNil; sesId_ = JET_sesidNil; return S_OK; }
/* * Close a previously opened database */ BOOL NTDS_CloseDatabase(s_parser *parser) { JET_ERR jet_err; jet_err = JetCloseDatabase(parser->sesid,parser->dbid,0); if(jet_err!=JET_errSuccess) { NTDS_ErrorPrint(parser,"JetCloseDatabase",jet_err); return FALSE; } jet_err = JetDetachDatabase(parser->sesid,parser->parsed_filename); if(jet_err!=JET_errSuccess) { NTDS_ErrorPrint(parser,"JetDetachDatabase",jet_err); return FALSE; } jet_err = JetEndSession(parser->sesid,0); if(jet_err!=JET_errSuccess) { NTDS_ErrorPrint(parser,"JetEndSession",jet_err); return FALSE; } return TRUE; }