Thank you for your kind advice. The problem was in using bad logger function. I misused it and it disturbed normal activity of my SQLiteDB engine. Now everything is OK. Thank you again.
intelstar venus
Posts
-
How to make a Windows service to manage SQLite DB -
How to make a Windows service to manage SQLite DBSorry, I tried to change it intentionally. The problem was settled. I found that I was so idiot. I had mistaken by using invalid Error Log function. ErrorManager::Instance()->ReportError(ErrorManager::Critical, ...); I'm very sorry to everybody. And very thanks all of you who had offered kind advises. ;)
-
How to make a Windows service to manage SQLite DB"select * from hm_dbversion" reports correct result. but next "select * from hm_settings" report nothing. If we change sQuery = "select * from hm_settings" directly, it reports proper result. But it actually useless in practice, and i need to process the dynamical SQL commands in the service. I can't find the reason and crashed with a barrier. Now I have a doubt in the timing of SQL commands. I'm so sorry for your efforts, best regards!
-
How to make a Windows service to manage SQLite DBThank 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 pDALConn, const SQLCommand &command, String &sErrorMessage) { String sSQL = command.GetQueryString(); try { std::shared_ptr pConn = std::static_pointer_cast (pDALConn); std::shared_ptr 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 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 DALConnectio
-
How to make a Windows service to manage SQLite DBCan I make debugging on the running service? And I'm using VS2015 but service debugging is seen somewhat different with normal application. Please teach me how to debug service program. :((
-
How to make a Windows service to manage SQLite DBThank you for your concern, I corrected my question. Please check it and give me the right way. Best regards!
-
How to make a Windows service to manage SQLite DBI used CppSQLite3_2.zip freeware and wrote some Windows service to manage SQLite DB. As a simple application, it acts well. ex. In the application for test, this code reported proper value. const char* gszFile = "e:\\Test\\Database\\Server.db3"; int TryOpen(char * sql) { SQLite3DBCpp *db = new SQLite3DBCpp; db->open(gszFile); SQLite3QueryCpp q = db->execQuery("select * from my_settings"); q.finalize(); db->close(); } But after implemented as a service, it doesn't returned any values. ex. in the service program, I used the above code directly. Here I tried to give SQL cmd as a parameter. AnsiString sQuery; ... SQLite3QueryCpp q = db->execQuery(sQuery.c_str()); If I give a static command such as "select * from my_settings" instead of sQuery.c_str(), it operated properly, but it doesn't act when it receives a dynamic params. In fact, if we dumped the sQuery.c_str(), the output was "select * from my_settings". What's the matter? Please tell me the reason. I think it'll be no problem in Linux, but I don't know the Windows inside well. Please help me, Best regards!