Click here to Skip to main content
15,124,646 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.

#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)
        int i, fld;
        time_t tmStart, tmEnd;
        CppSQLiteDB db;;
    catch (CppSQLiteException& e)
        cerr << e.errorCode() << ":" << e.errorMessage() << endl;
    return 0;
Updated 11-Oct-14 7:11am
[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...

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