resultCode = sqlite3_step(findHandle);
- if (resultCode != SQLITE_DONE){
+ if (resultCode != SQLITE_ROW){
return CDSCALENDAR_NOACCOUNT;
}
std::string sqlParameter = "UPDATE calendarentries SET entryname=(?2), entrydescription=(?3),"
" entrystartyear=(?4), entrystartmonth=(?5), entrystartday=(?6), entrystarthour=(?7), entrystartminute=(?8), entrystartsecond=(?9),"
" entryendyear=(?10), entryendmonth=(?11), entryendday=(?12), entryendhour=(?13), entryendminute=(?14), entryendsecond=(?15), "
- " entrydurationweek=(?16), entrydurationday=(?17), entrydurationhour=(?18), entrydurationminute=(?19), entrydurationsecond=(?20), "
+ " entrydurationweek=(?16), entrydurationday=(?17), entrydurationhour=(?18), entrydurationminute=(?19), entrydurationsecond=(?20) "
" WHERE id=(?1)";
resultCode = sqlite3_prepare_v2(db, sqlParameter.c_str(), -1, &statementHandle, nullptr);
-
+
resultCode = sqlite3_bind_int(statementHandle, 1, eventID);
if (resultCode != 0){
resultCode = sqlite3_prepare_v2(db, "DELETE FROM calendarentries", - 1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 1" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 2" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_prepare_v2(db, "DELETE FROM sqlite_sequence WHERE name='calendarentries';", -1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 3" << endl;
- cout << sqlite3_errmsg(db) << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 4" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_prepare_v2(db, "DELETE FROM calendars", -1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 5" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 6" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_prepare_v2(db, "DELETE FROM sqlite_sequence WHERE name='calendars';", -1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 7" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 8" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_prepare_v2(db, "DELETE FROM accounts", -1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 9" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 10" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_prepare_v2(db, "DELETE FROM sqlite_sequence WHERE name='accounts'", -1, &statementHandle, nullptr);
if (resultCode != 0){
- cout << "Fail 11" << endl;
return CDSCLEANUP_FAILED;
}
resultCode = sqlite3_step(statementHandle);
if (resultCode != SQLITE_DONE){
- cout << "Fail 12" << endl;
return CDSCLEANUP_FAILED;
}