SQL INSERT ISSUES
Posted: Fri Jul 04, 2008 3:23 pm
Hi
Again please excuse my lack of knowledge on how to do these things but I am trying to insert data from rev into a SQLite table which i have created.
It all connects ok but I just can't seem to get the data into the table.
I am taking information from a number of fields then trying to but it into the table using a button.
Here is the script I am using for the button;
on mouseUp
Global mydbid
local cname, bal, month, copen, inResult, dplan, inSQL, inResultb
put field "cardnamenew"into cname
put field "add balance"into bal
put field "add month pay"into month
put field "add card opened" into copen
put field "debt plan" into dplan
answer "Are "& cname &", "& bal &", "& month &", "& copen &","& dplan &" correct? " with "yes" or "no"
put it into inResult
put inResult into field "one"
put revOpenDatabase("SQLite",localhost,,,) into mydbid
put "INSERT INTO mydbid, Creditcard(cardname,balance,monthpay,cardopened,debtplan) VALUES("& cname &","& bal &","&month&","& copen &","& dplan &")" into inSQL
revExecuteSQL mydbid, inSQL
put the result into inResultb
if inResultb is not empty then
answer "card entered" else
answer "card not entered"
end if
answer information "Number of cards entered: " & inResultb
end mouseUp
Again thank you very much for any help.
Thanks
joby
Again please excuse my lack of knowledge on how to do these things but I am trying to insert data from rev into a SQLite table which i have created.
It all connects ok but I just can't seem to get the data into the table.
I am taking information from a number of fields then trying to but it into the table using a button.
Here is the script I am using for the button;
on mouseUp
Global mydbid
local cname, bal, month, copen, inResult, dplan, inSQL, inResultb
put field "cardnamenew"into cname
put field "add balance"into bal
put field "add month pay"into month
put field "add card opened" into copen
put field "debt plan" into dplan
answer "Are "& cname &", "& bal &", "& month &", "& copen &","& dplan &" correct? " with "yes" or "no"
put it into inResult
put inResult into field "one"
put revOpenDatabase("SQLite",localhost,,,) into mydbid
put "INSERT INTO mydbid, Creditcard(cardname,balance,monthpay,cardopened,debtplan) VALUES("& cname &","& bal &","&month&","& copen &","& dplan &")" into inSQL
revExecuteSQL mydbid, inSQL
put the result into inResultb
if inResultb is not empty then
answer "card entered" else
answer "card not entered"
end if
answer information "Number of cards entered: " & inResultb
end mouseUp
Again thank you very much for any help.
Thanks
joby