CRUD SQLite example
Posted: Mon Feb 28, 2011 12:18 am
I creating a CRUD SQLite example. (Create, Read, Update, & Delete)
I'll post the final stack stack in this thread, when it's done.
This code is basically just copied from the SQLite Samplier.rev example.
http://downloads.runrev.com/distributio ... er.rev.zip
I'm putting all the code in the Stack Script area. Each button has a single command,
which refers the the handler in the Stack Script area.
doConnect & doDissconnect work fine. I'm having a little trouble with the doCreate.
On the: put revExecuteSQL (gConID, tSQL) into tTmp I'm getting this error:
stack "myDBtest": execution error at line 32 (Function: error in function handler) near "revExecuteSQL", char 7
I tried removing the paren as per the revExecuteSQL example in the dictionary.
I am missing something obvious? I'm not sure what that "near" means in the error message.
And, is "char 7" from the beginning of the line?
I'll post the final stack stack in this thread, when it's done.
This code is basically just copied from the SQLite Samplier.rev example.
http://downloads.runrev.com/distributio ... er.rev.zip
I'm putting all the code in the Stack Script area. Each button has a single command,
which refers the the handler in the Stack Script area.
doConnect & doDissconnect work fine. I'm having a little trouble with the doCreate.
Code: Select all
on doCreate
if gConID is "" then -- defined at the top of the stack as a Global
answer information "No Database is Connected to. Press the Connect button first."
exit doCreate
end if
put "CREATE TABLE users(userID integer primary key, name text ,email text, emailList boolean)" into tSQL
put revExecuteSQL (gConID, tSQL) into tTmp
handleRevDBerror tTmp
if the result is not empty then
answer warning the result
exit doCreate
end if
answer information "First Table Added: " & tTmp
end doCreate
stack "myDBtest": execution error at line 32 (Function: error in function handler) near "revExecuteSQL", char 7
I tried removing the paren as per the revExecuteSQL example in the dictionary.
I am missing something obvious? I'm not sure what that "near" means in the error message.
And, is "char 7" from the beginning of the line?