SQLlite to DataGrid
Posted: Fri Apr 04, 2014 12:30 am
I haver a SQLLite database table with 9 columns. Every row is populated but not every field in the row contains data. To add to the confusion, some of the fields have multiple lines. I would like to get the entire table into a datagrid. A snipit of some of the test code is below:
The not yet complete function PrepForSteps looks like this
My intention was to put the items of the line into the array but it turns our that the lines differ in the number items so I am not sure how to handle it. Any suggestion for how to make this work or any alternate methods that are better would be appreciated.
Thanks,
Larry
Code: Select all
put "SELECT sKey,id,ord,radiscript,conditions,steps,labels,refs,notes FROM steps" into tSQL
put ExecuteSQL(tSQL) into tResult
put the number of lines of tResult into tLines
repeat with i=1 to tLines
put line i of tResult into tLine
put PrepForSteps(tLine) into tArray
dispatch "AddData" to group "DataGrid Steps" with tArray
end repeat
Code: Select all
function PrepForSteps tLine
set the itemdelimiter to tab
put the number of items of tLine into tItems
answer tItems & return & tLine
return tArray
end PrepForSteps
Thanks,
Larry