Mark Richards <[EMAIL PROTECTED]> wrote: > 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. >
Version 3.3.7 creates (by default) a database file that can be read or written by any version of SQLite back to version 3.0.0. There is no need to do the "PRAGMA legacy_file_format=ON". That is now the default. But you are trying to read the database with SQLite version 2.8.17, which is earlier (and vastly different) from version 3.0.0. -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------