void CParamDB::UpdatePKGParam(PARAM_ITEM param) { CppSQLite3DB db; try { if (FileExists(_sFilePath) == true) { db.open(AnsiString(_sFilePath).c_str()); String szSQL = " update RecipeParameter " " set " " Value = '" + FloatToStr(param.dValue) + "'" " where group_idx = '" + IntToStr(param.nGroup_idx) + "'" " and recipe_idx = '" + IntToStr(param.nRecipe_idx) + "'" " and parameter_idx = '" + IntToStr(param.nParameter_idx) + "'"; db.execDML( "begin transaction;" ); db.execDML(AnsiString(szSQL).c_str()); db.execDML( "commit transaction;" ); db.close(); } } catch (Exception &e) { db.close(); } }
bool CheckCreateSettingTable(CppSQLite3DB &dbTask) { try{ //如果表格不存在,则创建表格 if (!dbTask.tableExists("T_Setting")) //创建事件日志表 { //数据库字段:任务id,任务类型,任务时间,上次提示时间,提示语句等。 //last_run_time可以用来辅助确定提示是否已经执行,避免重复 dbTask.execDML("Create table T_Setting(" "key integer , " //key "value char[1024]);" //value ); //为类型字段建立索引 dbTask.execDML("create index idx_id on T_Setting(key);"); } return true; } catch(CppSQLite3Exception &exp) { exp; ATLTRACE("error:%s\n",exp.errorMessage()); ATLASSERT(FALSE); return false; } }
void CParamDB::InsertPKGParam(PARAM_ITEM param) { CppSQLite3DB db; try { if (FileExists(_sFilePath) == true) { db.open(AnsiString(_sFilePath).c_str()); String szSQL = " insert into RecipeParameter " " ( " " group_idx, recipe_idx, parameter_idx , value " " ) " " values " " (" " '" + IntToStr(param.nGroup_idx) + "', " " '" + IntToStr(param.nRecipe_idx) + "', " " '" + IntToStr(param.nParameter_idx) + "', " " '" + FloatToStr(param.dValue) + "') "; db.execDML( "begin transaction;" ); db.execDML(AnsiString(szSQL).c_str()); db.execDML( "commit transaction;" ); db.close(); } } catch (Exception &e) { db.close(); } }
bool CParamDB::DeletePKGParam(int nGroup_no, int nRecipe_no) { CppSQLite3DB db; bool bResult = false; try { if (FileExists(_sFilePath) == true) { db.open(AnsiString(_sFilePath).c_str()); String szSQL = " delete from RecipeParameter " " where group_idx = '" + IntToStr(nGroup_no) + "'" " and recipe_idx = '" + IntToStr(nRecipe_no) + "'"; db.execDML( "begin transaction;" ); bResult = db.execDML(AnsiString(szSQL).c_str()); db.execDML( "commit transaction;" ); db.close(); return bResult; } } catch (Exception &e) { db.close(); return false; } }
int CDbMeter::JoinTableDelete(const char* dbfilename) { try { CppSQLite3DB db; db.open(dbfilename); CppSQLite3Buffer bufSQL; CppSQLite3Table t; db.execDML("CREATE TABLE IF NOT EXISTS jointable (joinkey INTEGER PRIMARY KEY, EUI64ID CHAR(17), jointry INTEGER);"); bufSQL.format("SELECT * FROM jointable;"); t = db.getTable(bufSQL); if( t.numRows() == 0 ) { XDEBUG("Failure: Don't have JoinTable\r\n"); } else { db.execDML("DROP TABLE joinTable;"); } } catch( CppSQLite3Exception& e ) { XDEBUG("%s\r\n",e.errorMessage()); return e.errorCode(); } return SQLITE_OK; }
int CDbMeter::JoinTableAdd(const char* dbfilename, char* szID) { try { CppSQLite3DB db; db.open(dbfilename); CppSQLite3Buffer bufSQL; CppSQLite3Table t; db.execDML("CREATE TABLE IF NOT EXISTS jointable (joinkey INTEGER PRIMARY KEY, EUI64ID CHAR(17), jointry INTEGER);"); bufSQL.format("SELECT * FROM jointable WHERE EUI64ID=%Q", szID); t = db.getTable(bufSQL); if( t.numRows() == 0 ) { bufSQL.clear(); bufSQL.format("INSERT INTO jointable(EUI64ID, jointry) VALUES(%Q, %d);", szID, 0); db.execDML(bufSQL); } else XDEBUG("Jointable ID Duplicate!!\r\n"); db.close(); } catch( CppSQLite3Exception& e ) { XDEBUG("%s\r\n",e.errorMessage()); return e.errorCode(); } return SQLITE_OK; }
bool CheckCreateLogTable(CppSQLite3DB &dbTask) { try{ //如果表格不存在,则创建表格 if (!dbTask.tableExists("T_log")) //创建事件日志表 { //数据库字段:任务id,任务类型,任务时间,上次提示时间,提示语句等。 //last_run_time可以用来辅助确定提示是否已经执行,避免重复 dbTask.execDML("Create table T_log(" "id integer PRIMARY KEY AUTOINCREMENT, " //唯一id "modal char[128]," "time_log integer, " //时间 "type integer, " //状态 "value1 integer, " //值1 "value2 integer, " //值2 "message char[1024]);" //提示语句 ); //为类型字段建立索引 dbTask.execDML("create index idx_time on T_log(time_log);"); } return true; } catch(CppSQLite3Exception &exp) { exp; ATLTRACE("error:%s\n",exp.errorMessage()); ATLASSERT(FALSE); return false; } }
void CMissedCallsDlg::OnBnClickedButtonRemove() { // TODO: Add your control notification handler code here CString sDate, sTime, callee, callerID; int nItem = m_list.GetNextItem(-1, LVNI_SELECTED); if (nItem==-1) return; if (MessageBox(_("Are you sure you want to delete the selected items?"), APP_NAME, MB_YESNO | MB_ICONQUESTION)==IDYES) { CppSQLite3DB db; db.open(CStringA(OUTCALL_DB)); CString query, table; if (m_cboShow.GetCurSel()==0) table="MissedCalls"; else if (m_cboShow.GetCurSel()==1) table="RecivedCalls"; else table="PlacedCalls"; int nIndex; try { db.execDML("begin transaction"); while (nItem!=-1) { //from to time date callerID = m_list.GetItemText(nItem, 0); callee = m_list.GetItemText(nItem, 1); sDate = m_list.GetItemText(nItem, 2); nIndex = sDate.Find(_T(", ")); sTime = sDate.Mid(nIndex+2); sDate = sDate.Mid(0, nIndex); query = "delete from " + table + " where (CallerID='" + EscapeSQLString(callerID) + "' and Callee='" + EscapeSQLString(callee) + "' and Date='" + sDate +"' and Time='" + sTime + "')"; db.execDML(query.GetBuffer()); m_list.DeleteItem(nItem); nItem--; nItem = m_list.GetNextItem(nItem, LVNI_SELECTED); } db.execDML("end transaction"); } catch (CppSQLite3Exception& e) { } } BOOL bEnable = (m_list.GetNextItem(-1, LVNI_SELECTED)!=-1)?TRUE:FALSE; GetDlgItem(IDC_BUTTON_REMOVE)->EnableWindow(bEnable); GetDlgItem(IDC_BUTTON_CALL)->EnableWindow(bEnable); m_btnAddContact.EnableWindow(bEnable && (::theApp.GetProfileInt("Settings", "OutlookFeatures", 1)==1)); }
BOOL CDBObject::DeleteRecord(int nId) { char szSql[MAX_PATH] = {0}; sprintf_s(szSql, "delete from Record where id=%d", nId); CppSQLite3DB db; db.open(g_szFile); int nRet2 = db.execDML("begin transaction;"); string strSql = szSql; nRet2 = db.execDML(ASCII2UTF_8(strSql).c_str()); nRet2 = db.execDML("commit transaction;"); return TRUE; }
void CUserAcessSetDlg::InserSingleSetConfig() { CppSQLite3Table table; CppSQLite3Query q; CppSQLite3DB SqliteDBBuilding; SqliteDBBuilding.open((UTF8MBSTR)g_strCurBuildingDatabasefilePath); CString strSql; strSql.Format(_T("select * from UserLevelSingleSet where MainBuilding_Name='%s' and Building_Name='%s' and username='******'"),m_strMainBuilding,m_strSubNetName,m_strUserName); q = SqliteDBBuilding.execQuery((UTF8MBSTR)strSql); _variant_t temp_variant; BOOL b_useLogin=false; try { if(q.eof()) { strSql.Format(_T("insert into UserLevelSingleSet values('%s','%s','%s',%i,%i)"),m_strMainBuilding,m_strSubNetName,m_strUserName,0,0); SqliteDBBuilding.execDML((UTF8MBSTR)strSql); } SqliteDBBuilding.closedb(); } catch(_com_error *e) { AfxMessageBox(e->ErrorMessage()); } }
////////////////////////////////////////////////////////////////////////// // [3/21/2011 DHKim] // 그룹 테이블 생성 Table( GroupKey PrimaryKey, GroupName TEXT) ////////////////////////////////////////////////////////////////////////// int CDbMeter::db_Group_Create(const char* dbfilename) { try { CppSQLite3DB db; db.open(dbfilename); db.execDML("CREATE TABLE IF NOT EXISTS groups (GroupKey INTEGER PRIMARY KEY, GroupName TEXT);"); db.close(); } catch ( CppSQLite3Exception& e ) { return e.errorCode(); } return SQLITE_OK; /* sqlite3* db = NULL; if(sqlite3_open(dbfilename, &db) != SQLITE_OK) { XDEBUG("SQLite open failed: %s\r\n", sqlite3_errmsg(db)); return sqlite3_errcode(db); } if(sqlite3_exec(db, "CREATE TABLE IF NOT EXISTS groups (GroupKey) INTEGER PRIMARY KEY, GroupName TEXT", NULL, NULL, NULL) != SQLITE_OK) { XDEBUG("SQLite create failed: %s\r\n", sqlite3_errmsg(db)); return sqlite3_errcode(db); } sqlite3_close(db); return sqlite3_errcode(db); */ }
int CDbMeter::JoinTableShow(const char* dbfilename) { try { CppSQLite3DB db; db.open(dbfilename); CppSQLite3Buffer bufSQL; CppSQLite3Table t; db.execDML("CREATE TABLE IF NOT EXISTS jointable (joinkey INTEGER PRIMARY KEY, EUI64ID CHAR(17), jointry INTEGER);"); bufSQL.format("SELECT * FROM jointable;"); t = db.getTable(bufSQL); for ( int row = 0; row < t.numRows(); row++) { t.setRow(row); for (int fld=0; fld<t.numFields(); fld++) { if( !t.fieldIsNull(fld)) XDEBUG("%s | ", t.fieldValue(fld)); } XDEBUG("\r\n"); } } catch( CppSQLite3Exception& e ) { XDEBUG("%s\r\n",e.errorMessage()); return e.errorCode(); } return SQLITE_OK; }
void DBLog::Log( const char *pModel,int code,int value1,int value2, const char *pMessage ) { //打开数据库 CppSQLite3DB dbTask; dbTask.open(m_strDB.c_str()); CheckCreateLogTable(dbTask); CppSQLite3Buffer strSql; strSql.format("insert into T_Log values(NULL,'%q',%d,%d,%d,%d,'%q');", pModel,GlobeFuns::TimeToInt(CTime::GetCurrentTime()),code,value1,value2,pMessage ); try{ if(1!=dbTask.execDML(strSql)) { ATLASSERT(FALSE); return; } } catch(CppSQLite3Exception &exp) { exp; ATLTRACE("error:%s\n",exp.errorMessage()); ATLASSERT(FALSE); return; } }
void CDlgMemoAdd::OnBnClickedButtonSave() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); try{ CString strTime; strTime =m_DateTime_valTime.Format(_T("%Y-%m-%d %H:%M")); CString strSQL; CppSQLite3DB db; db.open(CBoBoDingApp::g_strDatabasePath);//打开数据库 strSQL.Format(_T("INSERT INTO Memo(MemoTime,Title,Content,CategoryName) VALUES('%s','%s','%s','%s');"),DealWithValue(strTime),DealWithValue(m_Edit_strTitle),DealWithValue(m_Edit_strContent),DealWithValue(m_Combo_strCategory)); db.execDML(strSQL); } catch (CppSQLite3Exception& e) { AfxMessageBox(e.errorMessage()); } m_bIsSave=true; OnOK(); }
std::string CWRecorder::dump() { using namespace boost; format day_fmt("%04d/%02d/%02d"); format time_fmt("%02d:%02d:%02d"); format table_name_fmt("%s_%04d%02d%02d_%02d%02d%02d"); // get current time time_t raw_time; tm* ptm; time(&raw_time); ptm = localtime(&raw_time); day_fmt%(ptm->tm_year+1900)%(ptm->tm_mon+1)%(ptm->tm_mday); time_fmt%(ptm->tm_hour)%(ptm->tm_min)%(ptm->tm_sec); table_name_fmt%name()%(ptm->tm_year+1900)%(ptm->tm_mon+1)%(ptm->tm_mday)%(ptm->tm_hour)%(ptm->tm_min)%(ptm->tm_sec); // add a record to RecordSummary table CppSQLite3DB* db = MyDatabase::shared_output_database(); if(!db->tableExists("RecordSummary")) { throw HException("RecordSummary does not exist in output database"); } format value_fmt("insert into RecordSummary values('%s','%s','%s')"); value_fmt%day_fmt.str()%time_fmt.str()%table_name_fmt.str(); db->execDML(value_fmt.str().c_str()); return table_name_fmt.str(); }
void CDlgProjectNew::OnBnClickedButtonSave() { // TODO: 在此添加控件通知处理程序代码 UpdateData(TRUE); if (m_Edit_strProjectName.IsEmpty()) { AfxMessageBox(_T("项目名称不能为空。")); return; } if(IsExistProjectName(m_Edit_strProjectName)==true) { AfxMessageBox(_T("项目名称已存在,请重新输入。")); return; } try{ CString strSQL; CppSQLite3DB db; db.open(CBoBoDingApp::g_strDatabasePath);//打开数据库 strSQL.Format(_T("INSERT INTO Project(ProjectName,AccountType,ShuoMing) VALUES('%s','%s','%s');"),m_Edit_strProjectName,m_Combo_strProjectClass,m_Edit_strInstruction); db.execDML(strSQL); } catch (CppSQLite3Exception& e) { AfxMessageBox(e.errorMessage()); } m_bIsSave=true; OnOK(); }
int main(int argc, const char * argv[]) { // insert code here... // std::cout << "Hello, World!\n"; CppSQLite3DB db; std::cout << "sqlite version: " << db.SQLiteVersion() << std::endl; db.open("test.db"); db.execDML("create table emp(empno int, empname char(20));"); int nRows = db.execDML("insert into emp values (7, 'David Beckham');"); std::cout << nRows << " rows inserted " << std::endl; return 0; }
// xian modify so that save faster std::string VehicleStateRecorder::dump() { using namespace boost; string table = BaseT::dump(); CppSQLite3DB* db = MyDatabase::shared_output_database(); format fmt = format("create table %s (i int, elapsed_time double,x double, y double, z double)")%table; // creat a new record table db->execDML( fmt.str().c_str() ); // using the table name as the fle name to generate a data file fmt = format(CommandOption::Option().OutDir+"\\%s")%table; ofstream outf(fmt.str().c_str()); // record the stuff unsigned int i=0; BOOST_FOREACH(BaseItemPtrT& p_record,m_Records) { ItemPtrT p = static_pointer_cast<ItemT>(p_record); if(p) { Point3D& pos = p->m_State.m_Ref.Position; //format fmt = format("insert into %s values(%d, %f, %f, %f, %f)")%table%i%(p->m_TimeElapse)%pos.x()%pos.y()%pos.z(); //db->execDML(fmt.str().c_str()); db saving too slow, direct save format fmt = format("%d, %f, %f, %f, %f")%i%(p->m_TimeElapse)%pos.x()%pos.y()%pos.z(); outf<<fmt.str().c_str()<<endl; ++i; } }
void CCarTypesDetailDialog::OnOK() { // TODO: Add extra validation here UpdateData(); // CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; CString sSQL; // // add? // if( m_iCarTypeFK == -1 ) { sSQL.Format("SELECT 1 FROM CarTypes WHERE type_id=\"%s\"",m_sCarTypeID); CppSQLite3Query q = pDB->execQuery((LPCTSTR)sSQL); // if(!q.eof()) { MessageBox("Duplcate Type ID!","LSC TrainOps Error",MB_ICONSTOP|MB_OK); return; } sSQL.Format("INSERT INTO CarTypes (id,type_id,description,active,passenger) VALUES (NULL,\"%s\",\"%s\",1,%d)",m_sCarTypeID,m_sCarTypeDescription,m_bPassenger?1:0); } else { sSQL.Format("UPDATE CarTypes SET type_id=\"%s\",description=\"%s\",passenger=%d WHERE id=%d",m_sCarTypeID,m_sCarTypeDescription,m_bPassenger?1:0,m_iCarTypeFK); } pDB->execDML((LPCTSTR)sSQL); CDialog::OnOK(); }
void CEditTrainDialog::OnCancel() { CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; try { pDB->execDML("DROP TABLE _TL;"); } catch (...) {} try { pDB->execDML("DROP TABLE _TI;"); } catch (...) {} CDialog::OnCancel(); }
int CDbMeter::GroupAddMember(const char* dbfilename, int nGroupKey, char* szMemberId) { try { CppSQLite3DB db; db.open(dbfilename); CppSQLite3Buffer bufSQL; CppSQLite3Query q; CppSQLite3Table t; int nFindgroupkey = -1; bufSQL.format("SELECT EUI64ID FROM member WHERE EUI64ID=%Q;", szMemberId); t = db.getTable(bufSQL); if( t.numRows() == 0 ) { bufSQL.clear(); bufSQL.format("INSERT INTO member VALUES(%Q, 'Meter', 'none', '1.0.0', '1.0.0', 'Nomal', 'None');", szMemberId); db.execDML(bufSQL); } bufSQL.clear(); bufSQL.format("SELECT * FROM groups WHERE GroupKey=%d;", nGroupKey); t = db.getTable(bufSQL); if( t.numRows() == 1) nFindgroupkey = atoi(t.fieldValue(0)); else nFindgroupkey = -1; if( nFindgroupkey >= -1) { bufSQL.clear(); bufSQL.format("INSERT INTO groupmember(EUI64ID, GroupKey) VALUES(%Q, %d);", szMemberId, nGroupKey); db.execDML(bufSQL); } db.close(); } catch( CppSQLite3Exception& e ) { XDEBUG("%s\r\n",e.errorMessage()); return -1; } return SQLITE_OK; }
void CPhoneLog::OnBtnDelLogState(int state) { m_ObArrary = NULL; m_Pos = 0; m_CurPage = 1; m_TotalPage = 0; UINT Tag = 0; //PhoneLogMng::Instance().DelLPhoneLogState(state); CppSQLite3DB db; db.open(PATH_SQLITE_DB_808); //打开数据库 char szSqlBuffer[512]; memset(szSqlBuffer, 0, sizeof(szSqlBuffer)); switch(enLog) { case PLACEDCALL: { Tag = 1; sprintf(szSqlBuffer, "DELETE FROM phone_log WHERE flag = '%d';", Tag); db.execDML(szSqlBuffer); } break; case RECEIVEDCALL: { Tag = 2; sprintf(szSqlBuffer, "DELETE FROM phone_log WHERE flag = '%d';", Tag); db.execDML(szSqlBuffer); } break; case MISSEDCALL: { Tag = 3; sprintf(szSqlBuffer, "DELETE FROM phone_log WHERE flag = '%d';", Tag); db.execDML(szSqlBuffer); } break; default: break; } db.close(); PostMessage(WM_ACTIVATE); }
void CEditTrainDialog::OnLocalswitcher() { UpdateData(); CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; CString sSQL; int iLocationID = m_ctlRouteLocationList.GetItemData(m_ctlRouteLocationList.GetCurSel()); sSQL.Format("UPDATE _TL SET localswitcher=%d WHERE Location_FK=%d;",m_bLocalSwitcher?1:0,iLocationID); pDB->execDML(sSQL); }
int CDBObject::InsertReocord(const char* pProvider, const char* pDVRName, string pId, int pChannelId, const char* pDVRAddr, int state, int type, const char* path, const char* file, const char* startTime, const char* endTime) { char szSql[MAX_PATH] = {0}; sprintf_s(szSql, "insert into Record values(NULL, '%s', '%s', '%s' , '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ", pId.c_str(), pDVRName, pProvider, pChannelId, pId.c_str(), pDVRAddr, file, path, "", "", startTime, endTime); CppSQLite3DB db; db.open(g_szFile); int nRet2 = db.execDML("begin transaction;"); string strSql = szSql; nRet2 = db.execDML(ASCII2UTF_8(strSql).c_str()); nRet2 = db.execDML("commit transaction;"); return (int)(db.lastRowId()); }
void CEditTrainDialog::OnChangeMaxMoves() { UpdateData(); CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; int iLocationID = m_ctlRouteLocationList.GetItemData(m_ctlRouteLocationList.GetCurSel()); CString sSQL; sSQL.Format("UPDATE _TL SET max_moves=%d WHERE Location_FK=%d;",m_iMaxMoves,iLocationID); pDB->execDML(sSQL); }
BOOL CDBObject::UpdateRecord(int nId) { char szTime[20] = {0}; SYSTEMTIME loctime; GetLocalTime(&loctime); sprintf_s(szTime, "%.4d%.2d%.2d%.2d%.2d%.2d%", loctime.wYear, loctime.wMonth, loctime.wDay, loctime.wHour, loctime.wMinute, loctime.wSecond); char szSql[MAX_PATH] = {0}; sprintf_s(szSql, "update Record set EndTime = '%s' where id=%d", szTime, nId - 1); CppSQLite3DB db; db.open(g_szFile); int nRet2 = db.execDML("begin transaction;"); string strSql = szSql; nRet2 = db.execDML(ASCII2UTF_8(strSql).c_str()); nRet2 = db.execDML("commit transaction;"); return TRUE; }
void CEditTrainDialog::OnItemchangedIndustrylist(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; *pResult = 0; if (pNMListView->uOldState == 0 && pNMListView->uNewState == 0) return; // No change // Old check box state BOOL bPrevState = (BOOL)(((pNMListView->uOldState & LVIS_STATEIMAGEMASK)>>12)-1); if (bPrevState < 0) // On startup there's no previous state bPrevState = 0; // so assign as false (unchecked) // New check box state BOOL bChecked = (BOOL)(((pNMListView->uNewState & LVIS_STATEIMAGEMASK)>>12)-1); if (bChecked < 0) // On non-checkbox notifications assume false bChecked = 0; if (bPrevState == bChecked) // No change in check box return; // Now bChecked holds the new check box state // // save this industry state temporarily into the _TI table: // int iIndustryFK = m_ctlIndustryList.GetItemData(pNMListView->iItem); CString sSQL; sSQL.Format("DELETE FROM _TI WHERE Industry_FK=%d;",iIndustryFK); CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; try { pDB->execDML(sSQL); } catch(...){} // if( bChecked ) { // int iLocationID = m_ctlRouteLocationList.GetItemData(m_ctlRouteLocationList.GetCurSel()); sSQL.Format("INSERT INTO _TI (Train_FK,Location_FK,Industry_FK) VALUES (%d,%d,%d);",m_iTrainID,iLocationID,iIndustryFK); pDB->execDML(sSQL); } }
void CEditTrainDialog::OnInterchangeCheck() { UpdateData(); // CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB; CString sSQL; int iLocationID = m_ctlRouteLocationList.GetItemData(m_ctlRouteLocationList.GetCurSel()); sSQL.Format("UPDATE _TL SET switch_interchanges=%d WHERE Location_FK=%d;",m_bSwitchInterchanges?1:0,iLocationID); pDB->execDML(sSQL); }
void CMissedCallsDlg::OnBnClickedOk() { // TODO: Add your control notification handler code here CppSQLite3DB db; db.open(CStringA(OUTCALL_DB)); try { db.execDML("update MissedCalls set NewCall=0 where NewCall=2"); } catch (CppSQLite3Exception& e) { } OnOK(); }
void CMissedCallsDlg::OnCancel() { CppSQLite3DB db; db.open(CStringA(OUTCALL_DB)); try { db.execDML("update MissedCalls set NewCall=0 where NewCall=2"); } catch (CppSQLite3Exception& e) { } CDialog::OnCancel(); }