[Gambas-user] Primary Key missing?

tobias tobiasboe1 at ...20...
Thu Nov 25 21:28:22 CET 2010


hello,

prooving my sqlite code, i have several buttons on a form, whose subs 
should do the same work in different ways (one just using Exec() method, 
the other does all work with the gambas objects (editing fields etc.)).

after this code:

Button2_Click:

   DIM hResult AS Result

   hConnection.Exec("create table test(id integer primary key, name 
varchar(10));")
   hConnection.Exec("insert into test(name) values(\"Aaron\");")
   hConnection.Exec("insert into test(name) values('Zacharias');")

   '1|Aaron
   '2|Zacharias

i have another button which should edit this table:

   DIM hResult AS Result

   hResult = hConnection.Edit("test", "name=&1", "Aaron")
   hResult["name"] = "Adam"
   hResult.Update()


but in the line where the Edit()-function is used, i get the error that 
there is no primary key in my table but didn't i specify one creating 
the table?

by the way... i found that i wasn't able to even find a command to edit 
a record in terminal; i wanted to proof if the sqlite3 program with the 
same commands would tell me the same...

regards,
tobi




More information about the User mailing list