> 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
> 

The syntax I know for sqlite is:

create table test(id integer, name varchar(10), primary key(id))

Try to create table by using the Table class, and not the Exec() method.

Otherwise, send me your sqlite database so that I look at it.

Regards,

-- 
Benoît Minisini

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to