Problem with database

Hi guys!

I need to save a record (in fact, some records) in a table in my database.
It seems to add the record (no error showed in the terminal window), but when I check it, I find no records in the database table.

Could anybody help me, please?, what am I doing wrong?

require “sqlite3”

local path = system.pathForFile(“data.db”, system.DocumentsDirectory)
db=sqlite3.open(path)

–Handle the applicationExit event to close the db
local function onSystemEvent( event )
if( event.type == “applicationExit” ) then
db:close()
end
end

local taboa_cabezas =[[CREATE TABLE IF NOT EXISTS tcabezas (id INTEGER PRIMARY KEY, arquivo, posx, posy);]]
db:exec(taboa_cabezas)

local cabeza0={}
cabeza0[1]=“baseCabeza.png”
cabeza0[2]=90
cabeza0[3]=120
local rexistro0=[[INSERT INTO tcabezas VALUES (NULL, ‘]]…cabeza0[1]…[[’,’]]…cabeza0[2]…[[’,’]]…cabeza0[3]…[[’);]]
db:exec(rexistro0)

–print all the table contents
for row in db:nrows(“SELECT * FROM tcabezas”) do
print(row.arquivo…" “…row.posx…” "…row.posy)
end

–setup the system listener to catch applicationExit
Runtime:addEventListener( “system”, onSystemEvent )
[import]uid: 13461 topic_id: 7253 reply_id: 307253[/import]

Ok. It’s just working! [import]uid: 13461 topic_id: 7253 reply_id: 25518[/import]