[Lazarus] SQLite database schema has changed

Luiz Americo Pereira Camara luizmed at oi.com.br
Wed Dec 3 02:06:41 CET 2008


Andrea Mauri escreveu:
> Dear All,
> I have a question regarding SQLite.
> I got an error: 'database schema has changed' when I run the following 
> code (code 1)  (when I execute the second Insert Query).
> If I run the code 2 I don't get the error and the program works fine.
> This always happens when I create a Table, then I create a query with 
> parameters, then I create another table and then I run the query.
> Otherwise (code 2) if I create a table, then I create and run the query 
> as a statement without parameters, then I create another table and then 
> run the same insert query statement without parameter I don't get the error.
> Is it a bug or something related to SQLite? (Same situation, same 
> queries and table I don't get any error using Firebird).
> Thanks,
> Andrea

Try to use the function sqlite3_enable_shared_cache with true as 
parameter in the start of your application.

The function declaration:

function sqlite3_enable_shared_cache(Enable: Boolean): LongInt; cdecl; 
external 'sqlite3';

Luiz



More information about the Lazarus mailing list