I can run the following script with the debugger off without generating an error.
If I run it with the debugger:
Apple Execution Error
Couldn’t write data because C and Objective-C pointers cannot be saved in scripts.
Offending object
«data optr00000000009B680000600000»
use AppleScript version "2.4"
use script "SQLite Lib2" version "1.0.0"
use scripting additions
set nameOfTopic to "anamewithsomerandomintegerTRASH"
set timedate to random number from 1 to 1.0E+9 as text
set theFolder to (choose folder with prompt "Pick Folder") as text -- folder locate database
set theFile to theFolder & nameOfTopic & " " & timedate & ".db"
set theString to "create table ThreadData (dateCollected text, timeCollected text, postName text)"
set anotherString to "insert into ThreadData values (:dateCollected, :timeCollected, :postName)"
set theDictionary to {dateCollected:"cat", timeCollected:"dog", postName:"cow"}
set theDb to createDB(theFile, theString)
updateDB(theDb, anotherString, theDictionary)
on updateDB(theDb, theString, theDictionary)
begin transaction db theDb
update db theDb sql string theString with dictionary theDictionary
commit db theDb
end updateDB
on createDB(theFile, theString)
set theDb to open db in file theFile with can create
update db theDb sql string theString
return theDb
end createDB