SQLite Forum

Get SQLITE_PROTOCOL error when opening database
Login
Update - I dumped all the code above and tried a different scheme. I used a wrapper for SQLite3 from https://github.com/neosmart/CppSQLite and used the same .lib and .dll files. Everything compiles and I get a different error, which is 14 or SQLITE_CANTOPEN. I suspected that was the problem. Why it was one off? Here is the code.

CppSQLite3DB m_dB;
const char* m_szFile = "db.sqlite3";
const char* m_szFilesTable = "Files";

void UI_Database::InitializeDatabase(void)
{
    bool fileTableExists = false;
    const char* ver;
    int verNumb = 0;
    
    ver = CppSQLite3DB::SQLiteHeaderVersion();
    ver = CppSQLite3DB::SQLiteLibraryVersion();
    verNumb = CppSQLite3DB::SQLiteLibraryVersionNumber();

    try
    {
        // Open the database.
        m_dB.open(m_szFile);

        // Check if database contains the 'Files' table.
        fileTableExists = m_dB.tableExists(m_szFilesTable);

        if (fileTableExists == false)
        {
        }
    }
    catch (CppSQLite3Exception& e)
    {
        // Show the exception.
        ver = e.errorMessage();
    }
}

Everything works except for getting an exception when open on the database is called. It returns SQLITE_CANTOPEN. I think it is getting blocked from opening by WinRT, but I don't know how to give it access. I just want to confirm my suspicions. Thanks.