SQLite Forum

Get SQLITE_READONLY when using UPDATE command
Here is some code I have before I ever call sqlite3_open(). It is to show you the pieces I have or don't have.

database.h file:
extern sqlite3* ptrMain_Db;
SQLITE_EXTERN char* sqlite3_temp_directory;

const char* m_Main_Db_File ;

database.cpp file:(in constructor)
m_Main_Db_File = "file:\\Users\\David\\test.db";

// Assert the database versions.
assert(sqlite3_libversion_number() == SQLITE_VERSION_NUMBER);
assert(strncmp(sqlite3_sourceid(), SQLITE_SOURCE_ID, 80) == 0);
assert(strcmp(sqlite3_libversion(), SQLITE_VERSION) == 0);

// Make the sqlite3 temp directory.
LPCWSTR zPath = ApplicationData::Current().TemporaryFolder().Path().data();
char zPathBuf[MAX_PATH + 1];
memset(zPathBuf, 0, sizeof(zPathBuf));
WideCharToMultiByte(CP_UTF8, 0, zPath, -1, zPathBuf, sizeof(zPathBuf), NULL, NULL);
sqlite3_temp_directory = sqlite3_mprintf("%s", zPathBuf);

This is how I use sqlite3_open().
int result = sqlite3_open(m_Main_Db_File, &ptrMain_Db);

I moved the database file to my user folder which I should have full permission rights to. Now I get a hex E from result. I tried all the possible ways for my file string. Without the file:, single back slashes which Windows did not like, and forward slashes. I got the same result, E. This is different from when the database was in my project folder.

In VS I have installed SQLite/SQL Server Compact Toolbox. From this too I can always access and modify any SQLite database. This is how I have been making changes to the database so far. Is this tool causing my problems?