Click here to Skip to main content
15,844,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC CListCtrl how to Display SubItem text with tabulator ? Pin
David Crow9-Nov-15 2:59
David Crow9-Nov-15 2:59 
QuestionHow to make a Windows service to manage SQLite DB Pin
intelstar venus1-Nov-15 12:41
intelstar venus1-Nov-15 12:41 
AnswerRe: How to make a Windows service to manage SQLite DB Pin
Richard MacCutchan1-Nov-15 23:07
mveRichard MacCutchan1-Nov-15 23:07 
GeneralMessage Closed Pin
2-Nov-15 5:53
intelstar venus2-Nov-15 5:53 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
Richard MacCutchan2-Nov-15 6:01
mveRichard MacCutchan2-Nov-15 6:01 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
intelstar venus2-Nov-15 6:20
intelstar venus2-Nov-15 6:20 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
Richard MacCutchan2-Nov-15 6:22
mveRichard MacCutchan2-Nov-15 6:22 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
intelstar venus2-Nov-15 6:41
intelstar venus2-Nov-15 6:41 
Thank you for your kindly advice.
But my vaccine 365 security reject it as a virus. But www.virustotal.com doesn't report it as a virus. I also have no clue on it, maybe the vaccine detects the approach to the registry by debug mode built service.
Now I'm using Error log file and monitor its action.

Please check this function and give me your precious advice.

DALConnection::ExecutionResult
SQLiteRecordset::TryOpen(std::shared_ptr<dalconnection> pDALConn, const SQLCommand &command, String &sErrorMessage)
{

String sSQL = command.GetQueryString();
try
{
std::shared_ptr<sqliteconnection> pConn = std::static_pointer_cast <sqliteconnection>(pDALConn);
std::shared_ptr<sqlite3dbcpp> dbengin_ = pConn->GetConnection();

AnsiString sQuery;
if (!Unicode::WideToMultiByte(sSQL, sQuery))
{
ErrorManager::Instance()->ReportError(ErrorManager::Critical, 5108, "SQLiteRecordset::TryOpen", "Could not convert string into multi-byte.");
return DALConnection::DALUnknown;
}

record_cnt_ = cur_row_ = 0;
field_list_.clear();
value_list_.clear();

ErrorManager::Instance()->ReportError(ErrorManager::High, 3156, "SQLiteRecordset::TryOpen", sQuery);

/*
sQuery = "select * from my_settings";
If I set this value like this, SQL query will be succeed, but only using sQuery normally will be failed. Simple query such as "select * from my_dbversion" will be succeed but large data querying will be failed. I don't know the clue.
*/

SQLite3QueryCpp query_ = dbengin_->execQuery(sQuery);

int numFld = query_.numFields();
String data = "\n";

for (int i = 0; i < numFld; i++)
{
field_list_.push_back(query_.fieldName(i));
data += query_.fieldName(i);
data += "\t";
}
data += "\n";
while (!query_.eof())
{
std::vector<ansistring> sRow;
   for (int i = 0; i < numFld; i++){
    sRow.push_back(query_.fieldValue(i));

data += query_.fieldValue(i);
data += "\t";
  }
  data += "\n";
  value_list_.push_back(sRow);
  record_cnt_++;
  query_.nextRow();

}
query_.finalize();

ErrorManager::Instance()->ReportError(ErrorManager::High, 3156, "SQLiteRecordset::TryOpen ...", data);

}
catch (...)
{
ErrorManager::Instance()->ReportError(ErrorManager::High, 4202, "SQLiteRecordset::TryOpen", "An unknown error occurred while executing " + sSQL);
   return DALConnection::DALErrorInSQL;

}

return DALConnection::DALSuccess;
}

Error Log look like this

ERROR" 5928 "2015-11-02 18:17:33.876" "Severity: 1 (Critical), Code: HM3156, Source: SQLiteConnection::Connect Starting..., Description: e:\develop\MiniMail\Test\Database\MailServer.db3"
"ERROR" 5928 "2015-11-02 18:17:33.877" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen, Description: select * from hm_dbversion"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen ..., Description:
value

5601

"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::FindRecValue found..., Description: value==>5601"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 2 (High), Code: HM3156, Source: SQLiteRecordset::TryOpen, Description: select * from hm_settings"
"ERROR" 5928 "2015-11-02 18:17:33.879" "Severity: 3 (Medium), Code: HM5015, Source: PropertySet::GetProperty_(), Description: The property usescriptserver could not be found."
GeneralRe: How to make a Windows service to manage SQLite DB Pin
Richard MacCutchan2-Nov-15 7:25
mveRichard MacCutchan2-Nov-15 7:25 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
intelstar venus2-Nov-15 7:44
intelstar venus2-Nov-15 7:44 
QuestionRe: How to make a Windows service to manage SQLite DB Pin
David Crow2-Nov-15 10:14
David Crow2-Nov-15 10:14 
AnswerRe: How to make a Windows service to manage SQLite DB Pin
intelstar venus2-Nov-15 22:28
intelstar venus2-Nov-15 22:28 
AnswerRe: How to make a Windows service to manage SQLite DB Pin
jschell3-Nov-15 17:12
jschell3-Nov-15 17:12 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
intelstar venus4-Nov-15 2:05
intelstar venus4-Nov-15 2:05 
GeneralRe: How to make a Windows service to manage SQLite DB Pin
jschell7-Nov-15 5:58
jschell7-Nov-15 5:58 
Questionsocket:send integer Pin
Member 114755491-Nov-15 5:51
Member 114755491-Nov-15 5:51 
QuestionRe: socket:send integer Pin
Richard MacCutchan1-Nov-15 6:36
mveRichard MacCutchan1-Nov-15 6:36 
AnswerRe: socket:send integer Pin
Member 114755496-Nov-15 5:15
Member 114755496-Nov-15 5:15 
GeneralRe: socket:send integer Pin
Richard MacCutchan6-Nov-15 5:17
mveRichard MacCutchan6-Nov-15 5:17 
AnswerRe: socket:send integer Pin
Jochen Arndt1-Nov-15 22:07
professionalJochen Arndt1-Nov-15 22:07 
GeneralRe: socket:send integer Pin
Member 114755496-Nov-15 5:16
Member 114755496-Nov-15 5:16 
Questionuint32_t result of uint16_t addition Pin
elelont230-Oct-15 4:44
elelont230-Oct-15 4:44 
AnswerRe: uint32_t result of uint16_t addition Pin
Jochen Arndt30-Oct-15 5:00
professionalJochen Arndt30-Oct-15 5:00 
AnswerRe: uint32_t result of uint16_t addition Pin
jeron130-Oct-15 5:08
jeron130-Oct-15 5:08 
AnswerRe: uint32_t result of uint16_t addition Pin
CPallini30-Oct-15 5:24
mveCPallini30-Oct-15 5:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.