Hey sqliters, I am having a strange or maybe not so strange problem with my sqlite db. I have a field of "Text" type and it worked like a charm with any English texts for ages.
The text in the field used to come from an MFC CEdit. Now I switched to CRichEditCtrl to support formatting and UNICODE texts. The CRichEditCtrl dumps the formatted text in hex form like: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg 2;}} ect.
Once againt the sqlite saves it most of the time just fine. But some time it doesn't giving an error code SQLITE_ERROR /* SQL error or missing database */. the message is not too helpful. the db exists and save most of the time???? Go figure. Here is the code:
error = sqlite3_exec(db,cmd,0,0,0);
if (error != SQLITE_OK){
errMsg.Format("Unable to save notes to: %s\nSQLite Error: %d",filename,error);
AfxMessageBox(_T(errMsg));
sqlite3_close(db);
return false;
}
Nothing out of ordinary I think.
Please let me know if you have any ideas. Can it be due to lots of backslashes in the RTF format which somehow confuses sqlite?? Oh, it's not related to size of text saved. thanks a lot. Val