Page 2 of 2

Re: SQlite newbie question

Posted: Mon May 30, 2011 4:13 pm
by bangkok
CliveC wrote: The only explanation I can think of is the WHERE statement?
... yes of course !

It doesn't make sense to put a condition on a record... that does not even exist (because it is not yet created).
;-)
Furthermore your syntax is wrong.
Check :
http://www.tutorialspoint.com/mysql/mys ... -query.htm

So your query should be :

put "INSERT INTO project_settings (project_name,working_title) VALUES ( ' " & tProjName & " ', ' " & tWorkingTitle & " ' ) " into tSql
revExecuteSql tCon, tSql

And within your table structure, you declare a column "project_id", and you give to it the "auto increment" default, with for instance an INT (integer) datatype.
And you finish, by giving this column the status of "primary key".

Therefore, each record you'll insert will get a unique identifier : project_id.