Click here to Skip to main content
15,894,017 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to open a db file using sqlite but it throw a exception "file is encrypted or not a database.

C
#include "CppSQLite.h"
#include <ctime>
#include <iostream>
#include <fstream>
using namespace std;
const char* gszFile = "D:\\doc\\SQLiteDatabaseBrowserPortable\\Data\\asset.db"; 
int main(int argc, char** argv)
{
    try
    {
        int i, fld;
        time_t tmStart, tmEnd;
        CppSQLiteDB db;
        db.open(gszFile);
    }
    catch (CppSQLiteException& e)
    {
        cerr << e.errorCode() << ":" << e.errorMessage() << endl;
    }
    return 0;
}</fstream></iostream></ctime>
Posted
Updated 11-Oct-14 6:11am
v4
Comments
[no name] 11-Oct-14 9:56am    
You might be better off asking at where ever you got the code from for CppSQLiteDB.
nv3 11-Oct-14 12:38pm    
It's probably just what the message says: The file asset.db is probably encrypted or not a database at all.

1 solution

The Error is somehow unspecified. You should google it, and traverse the problem.

Maybe you have only a typo...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900