SQLite DataBase : How to set PrimaryKey & AutoIncrement etc
Posted: Thu Jan 10, 2013 5:03 pm
Hi,
I've managed to follow the various demo stuff to create a SQLite database within LiveCode - no real issues there
BUT what I seem unable to do is to set the first field as the Primary Key and have it Auto Increment etc...
I've downloaded and am trialling SQLite Admin which will allow me to do this outwith LiveCode but I really need to be able to do this from within LiveCode - exactly as I've done so far to detect if the DB exists and, if not, create one and then detect the existance of each of the DB tables/files and, if not, create each table/file and then all the the records within each of them.
I just don't see how to configure the various 'properties' of each field within a database table...
fyi, I've been using the SQLite example code and specifically the :
This all workd BUT I need tell the DB that the first field (ID) is to be the Primary Key and is to Auto Increment... etc... etc...
Can anyone kick me in the right direction please ?
Eternally grateful... Cheers
I've managed to follow the various demo stuff to create a SQLite database within LiveCode - no real issues there

BUT what I seem unable to do is to set the first field as the Primary Key and have it Auto Increment etc...
I've downloaded and am trialling SQLite Admin which will allow me to do this outwith LiveCode but I really need to be able to do this from within LiveCode - exactly as I've done so far to detect if the DB exists and, if not, create one and then detect the existance of each of the DB tables/files and, if not, create each table/file and then all the the records within each of them.
I just don't see how to configure the various 'properties' of each field within a database table...
fyi, I've been using the SQLite example code and specifically the :
Code: Select all
put "CREATE TABLE DBImages (ID char(8), Name char(50), DoB char(10), DateJoined char(10) [,etc ,etc ,etc] )" into sDBTableData
revExecuteSQL nDBConnectionID, sDBTableData
Can anyone kick me in the right direction please ?
Eternally grateful... Cheers