Populating Datagrid (Form) with Results of Search of SQLite
Posted: Sat Feb 11, 2017 8:03 am
I have a SQLite database of records. Each record has 13 fields. I want to put the results of a search query into the following datagrid form, which has just six text fields and one image:
I am using the following excerpt from the default script of the datagrid:
When the script does the search, I see that rows of the datagrid are populated equal to the number of hits. The default label field of the datagrid form displays all 13 tab-delimited fields of each record.
However, I want my script to put the 6 pieces of text data from each record into the corresponding fields of the form. I can't find any explanation in this forum or the LC lessons on datagrids and SQLite databases. I am novice, but I sense that advanced manipulation of the array variable pDataArray is required. I not asking anyone to write my script if much work is required, but if so perhaps someone could link to a resource or point me in the right direction. Thanks so much.
Monty May
My search code is thus:
Code: Select all
global gDatabaseID
on mouseup
put fld "query" into theSearchString
get revDataFromQuery(tab, return, gDatabaseID, "SELECT * FROM opsDetails WHERE keys LIKE '%" & theSearchString & "%'")
set the dgText of group "Datagrid 1" to it
end mouseup
Code: Select all
on FillInData pDataArray
set the text of field "Label" of me to pDataArray["label 1"]
end FillInData
However, I want my script to put the 6 pieces of text data from each record into the corresponding fields of the form. I can't find any explanation in this forum or the LC lessons on datagrids and SQLite databases. I am novice, but I sense that advanced manipulation of the array variable pDataArray is required. I not asking anyone to write my script if much work is required, but if so perhaps someone could link to a resource or point me in the right direction. Thanks so much.
Monty May