With sqlite version 3.3.7 if I create a new database using:
if (sqlite3_open("/var/tmp/solarwave/aem.db", &db)!=0)
{
printf("Cannot open db\n");
return(false);
}
and then issue the following:
snprintf(query, QUERY_SIZE, "%s", "PRAGMA legacy_file_format = ON");
nResult=sqlite3_exec(db, query, NULL, NULL, &cError);
snprintf(query, QUERY_SIZE, "%s", "PRAGMA auto_vacuum = 1");
nResult=sqlite3_exec(db, query, NULL, NULL, &cError);
snprintf(query, QUERY_SIZE, "%s", "PRAGMA empty_result_callbacks =
1");
nResult=sqlite3_exec(db, query, NULL, NULL, &cError);
snprintf(query, QUERY_SIZE, "%s", "PRAGMA synchronous = NORMAL");
nResult=sqlite3_exec(db, query, NULL, NULL, &cError);
Everything works fine - within the application. However I have a
php/sqlite combo that also talks to the same database. When it does, I get
Warning: sqlite_open(): file is encrypted or is not a database
in /mnt/flash/runtime/exec/dumprecords.php on line 46
Doesn't PRAGMA legacy_file_format = ON cover this? The docs state:
When this flag is on, new SQLite databases are created in a file
format that is readable and writable by all versions of SQLite
going back to 3.0.0. When the flag is off, new databases are
created using the latest file format which might to be readable
or writable by older versions of SQLite.
Now since the docs say "When this flag is ON, new SQLite databases are
created in a file format that is readable...", I wondered if this meant
that I have to set the PRAGMA *before* creating the db? How is that
possible??
Or maybe this PRAGMA is broken?
/m
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------