(Resolved) Confused (as usual)
Posted: Tue Jun 05, 2012 7:01 pm
Code: Select all
command saveMessageBookDetails
local tPos
local tSermonCode, tSermonYear, tSermonTitle, tSermonText
put getDatabaseID() into tDatabaseID
if tDatabaseID <> 0 then
get the selectedText of field "Result"
put it into tMessageTitle
-- extract Sermon code
put offSet(" ",tMessageTitle) into tPos
get char 1 to tPos of tMessageTitle
put it into tSermonCode
-- extract Sermon title
get char tPos+1 to len(tMessageTitle) of tMessageTitle
put it into tSermonTitle
-- extract message year
put char 1 to 2 of tMessageTitle into tYear
put "19"&tYear into tSermonYear
-- extract the suffix
put offSet(".rtf",tSermonTitle) into tPos
get char 1 to tPos-1 of tSermonTitle
put it into tSermonTitle
put the field "TheMessage" into tSermonText
put "INSERT INTO messageBookDetails " \
& " ( SermonCode, YearOfSermon, SermonTitle, SermonText ) " \
& " values ( tSermonCode, tSermonYear, tSermonTitle, tSermonText)" into tSQL
revExecuteSQL tDatabaseID, tSQL
if the result is not 1 then
answer warning the result
exit saveMessageBookDetails
end if
else
answer information "Connect to Database First"
end if
end saveMessageBookDetails
I've been struggerling for awhile now trying to understand the error. Any help would be appriciated.