I try to use this code to learn but I do not get the data inserted in the table
what I am doing wrong?
thank you for the help
Code: Select all
on mouseUp
global gConID
local tColumnItems
put "name," into tColumnItems
local tRowData
repeat for each item I in tColumnItems
ask question "New value for column: " & I
if it is empty or the result is "cancel" then exit to top
put "'" & cleanSQL(it) & "'" & "," after tRowData
end repeat
ask question "New value for column: emailList" with "true"
if it is empty or the result is "cancel" then exit to top
put "'" & cleanSQL(it) & "'" after tRowData
put "INSERT INTO vendors(RecNo,name,EmailList)" & \
" VALUES(null," & tRowData & ")" into tSQL
local tResult
revExecuteSQL gConID, tSQL
put the result into tResult
handleRevDBerror tResult
if the result is not empty then
answer warning the result
exit mouseUp
end if
answer information "Number of rows added: " & return & tResult
end mouseUp
function cleanSQL pSQL
replace "'" with "''" in pSQL
return pSQL
end cleanSql