You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i try to encrypt an existing database it gets corrupted and gives the file is encrypted or is not a database error is there no export feature for this case. I tried modifying the code to something like.
// for opening the database
boolean bExist;
boolean encrypted;
int nRes;
if( CRhoFile::isFileExist(strDbPath.c_str()) && checkImportState) {
encrypted = false;
bExist = CRhoFile::isFileExist((strDbPath).c_str());
nRes = sqlite3_open((strDbPath).c_str(),&m_dbHandle);
LOG(INFO)+"Opening without encryption";
} else {
encrypted = true;
bExist = CRhoFile::isFileExist((strDbPath+"_enc").c_str());
nRes = sqlite3_open((strDbPath+"_enc").c_str(),&m_dbHandle);
LOG(INFO)+"Opening with encrypted";
}
// for the PRAGMA call
if ( szEncrypt && strcmp(szEncrypt, "1") == 0 && encrypted)
// and finally after all that
if( !encrypted )
{
String strCreate = "select name from sqlite_master where type='table' and name!='sqlite_seqeunce' and rootpage>0;";
IDBResult res = executeSQL( strCreate.c_str() );
CDBAdapter db(m_strDbPartition.c_str(), true);
// this db opens with the pragma call as i have put logs there to be sure
db.open( strDbPath, m_strDbVer, true, false );
db.startTransaction(); # all this also works fine
for ( ; !res.isEnd(); res.next() ) {
String createTableStatement = res.getStringByIdx(0);
LOG(INFO)+"copying table "+createTableStatement;
copyTable( createTableStatement, *this, db );
}
db.endTransaction();
db.close();
close(false);
CRhoFile::deleteFile(strDbPath.c_str());
// here the strDbPath_enc database that is opened still gives the file is encrypted or not a database error.
open( strDbPath, m_strDbVer, false, false );
}
The text was updated successfully, but these errors were encountered:
If i try to encrypt an existing database it gets corrupted and gives the file is encrypted or is not a database error is there no export feature for this case. I tried modifying the code to something like.
The text was updated successfully, but these errors were encountered: