KeirS could I trouble you just one more time to cast your eye over this?
SQL.ExecNonQuery("CREATE TABLE Bosses (bossno INTEGER PRIMARY KEY , desc TEXT, sdate TEXT, ssos int, ddate TEXT, dsos int, actioned TEXT,notes TEXT,adate TEXT, atime TEXT, asos int ,cdate TEXT, ctime TEXT, csos int,device text,ccmail text,importance text)")
SQL.ExecNonQuery("CREATE TABLE Bosssubs (bosssubno INTEGER PRIMARY KEY , bossno int, desc TEXT, bdate TEXT, btime TEXT, foreign key(bossno) REFERENCES Bosses(bossno) on delete RESTRICT)")
This is how I Have created my database in a B4A program. I am able to for example to delete a record on Bosses where bossno = 123 even if there is a record on Bosssubs where bossno = 123.
After running this code that you gave me foreign key = 1 is logged.
Dim R As Reflector
R.Target = SQL
R.Target = R.GetField("db")
R.Runmethod2("setForeignKeyConstraintsEnabled",True,"java.lang.boolean")
oCursor = oSQL.ExecQuery("PRAGMA foreign_keys")
oCursor.Position = 0
Log("foreign_keys = " & oCursor.GetString2(0))
Can you perhaps think of someting else that should be set?
Many thanks.