Problem creating fields after upgrade to SQLiteDatabase

Occasionally I need to add a new field to an existing users database. I’ve been using this after checking the field doesn’t exist:

db.SQLExecute ("ALTER TABLE myTable ADD COLUMN dateSold Date")

If has worked well for many years but since changing from RealSQLdatabase to SQLiteDatabase this fails but only when an old database was created as a RealSQLdatabase.
The field simply doesn’t get created.
Has anyone else had this occur.

SQLite is limited in its ALTER TABLE commands

http://www.sqlitetutorial.net/sqlite-alter-table/

However your requirement IS supported… did you check the DB error message?

[quote=448807:@Craig Grech]Occasionally I need to add a new field to an existing users database. I’ve been using this after checking the field doesn’t exist:

db.SQLExecute ("ALTER TABLE myTable ADD COLUMN dateSold Date")

If has worked well for many years but since changing from RealSQLdatabase to SQLiteDatabase this fails but only when an old database was created as a RealSQLdatabase.
The field simply doesn’t get created.
Has anyone else had this occur.[/quote]

You shuldnt mix an old database format with the newer SQLite and expect good results. If you are going to upgrade the database engine, you should create a new database and transfer the data.

I use to use RealSQLDatabase and then later move to SQLiteDatabase and i don\t need to create new database and transfer from the old db to the new one.

Craig, do u try running the SQL statement directly on the database using a SQLite db browser like SQLiteManager???

REALSQL is simply older version of SQLite embedded in the REAL SQL plugin
Using a database from REAL SQL with the newer plugin should not be an issue

will ask one last time… did you check the error message from the database after attempting this query?