|
@@ -20,7 +20,7 @@ BOOL CDataImpl::Open()
|
|
|
{
|
|
|
Close();
|
|
|
CHAR szpath[MAX_PATH] = {0};
|
|
|
- _stprintf_s(szpath, _T("%ssms.db"), Global::g_szCurModuleDir);
|
|
|
+ _stprintf_s(szpath, _T("%sscbc.db"), Global::g_szCurModuleDir);
|
|
|
std::string strPath;
|
|
|
if ( !CharEncoding::ASCII2UTF8(szpath,strPath))
|
|
|
{
|
|
@@ -445,6 +445,8 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
nRet = sqlite3_finalize(stmt);
|
|
|
if ( nRet != SQLITE_OK )
|
|
|
{
|
|
|
+ // »Ø¹öÊÂÎñ;
|
|
|
+ nRet = sqlite3_exec(m_psqlite3, "rollback;", 0, 0, &psqlite_error);
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
@@ -458,6 +460,42 @@ INT CDataImpl::BatchInsertKeyInfo(std::vector<STKeys> &vtdata)
|
|
|
return vtdata.size();
|
|
|
}
|
|
|
|
|
|
+BOOL CDataImpl::UpdateMidInfo(STMid &data)
|
|
|
+{
|
|
|
+ if(m_psqlite3 == NULL)
|
|
|
+ return FALSE;
|
|
|
+
|
|
|
+ std::string strInsert = "UPDATE mid SET pid ='";
|
|
|
+ strInsert.append(data.pid);
|
|
|
+ strInsert.append("', ctype='");
|
|
|
+ strInsert.append(data.ctype);
|
|
|
+ strInsert.append("', version='");
|
|
|
+ strInsert.append(data.version);
|
|
|
+ strInsert.append("', purl='");
|
|
|
+ strInsert.append(data.purl);
|
|
|
+ strInsert.append("', psize='");
|
|
|
+ strInsert.append(data.psize);
|
|
|
+ strInsert.append("', pmd5='");
|
|
|
+ strInsert.append(data.pmd5);
|
|
|
+ strInsert.append("', number='");
|
|
|
+ strInsert.append(data.number);
|
|
|
+ strInsert.append("'");
|
|
|
+ strInsert.append(" WHERE bid ='");
|
|
|
+ strInsert.append(data.order);
|
|
|
+ strInsert.append("';");
|
|
|
+
|
|
|
+ char* psqlite_error = NULL;
|
|
|
+ int sqlite_error = sqlite3_exec(m_psqlite3, strInsert.c_str(), NULL, 0, &psqlite_error);
|
|
|
+ if(SQLITE_OK != sqlite_error)
|
|
|
+ {
|
|
|
+ //Global::WriteTextLog(_T("UpdateContactsType:%s"), psqlite_error);
|
|
|
+ FREE_MSG2
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
+}
|
|
|
+
|
|
|
BOOL CDataImpl::UpdateDownloadStatus(std::string order, int status, std::string des /* = "" */ )
|
|
|
{
|
|
|
if(m_psqlite3 == NULL)
|