I have a rather simple application that saves image data to a sqlite database.
I have a series of popup menus, radio buttons & check boxes that allow the user to set options for the image to the database.
I have a list box that shows the data from 5 fields in the db.
When I click from line to line in the list box, it takes ~7 seconds for the associated controls to display the proper values.
The database has a field: “requirements”
When the list box loads the items from the record set, and you click, on say the first entry, The code takes the value that is in “requirements” and then set the proper true/false value for the check box in the user interface:
Here is the code, which I have expanded a bit for clarity:
// grab the data from the recordset (rs)
command = rs.Field(“requirements”).StringValue
//for clarity, I stepped this out as there are three possible values that can be in the requirement field, all separated by a space, I am looking
for the first value, so I use NthField:
myvalue = NthField(command," ",1)
//Now I check to see if it is the value I am looking for, and then I set the control to look proper for the user:
if myvalue = “Proof-Required” then
window1.CheckBox1.value = true
window1.CheckBox1.value = false
According to the Profiler, this event is taking an average of 1865 milliseconds. I have 17 user interface controls that require possible updating, depending on what the database values are.
I created a method to handle just the updates to the UI, then pass the recordset to the method: UpdateControls(rs) which is called when the listbox containing my dataset is changed. Profiler shows the UpdateControls method requiring an average of 7300 milliseconds to complete.
Here is another odd issue: I am putting the image that I am processing through the PictureToString & StringToPicture functions (per the Language reference) to store the image to the database. That process only takes about ~400 milliseconds.
So it is taking around 7 seconds to update controls, but less than 1/2 second to process an 8 meg image to a string & then write that string info to the database!
Any help would be terrific