LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I populate a ListBox with the results of a sql query displaying the text values, but when I update a record, I want to update it with the number key. I'm using access

An SQL query returns data as a 2D string array.
From it you can pick a record (row) or a field content (column) using the Index Array function (it returns 1D string array).
Then you can insert this 1D array in the listbox using its property (attribute node) Item Names.

If you update your database you have to repeat the above steps in order to update the lisbox content.
It's not clear what you mean with number key.

Let me know if you need some more explaination.

Regards,
Alberto
0 Kudos
Message 2 of 3
(2,839 Views)
I think what he means by update by number key is that the values he is fetching are numbers, but they come back as strings. He wants to update the value that came back using the numeric keypad and store this updated entry.

When the 2D array of strings comes back you have to index the cell of interest using the array functions. Take this resulting string and feed it into one of the string to number conversion vi's (they are found under the string sub-palette of the functions palette). Then display the number in a numeric control. Once updated, you have to do the reverse, i.e. convertt back to string, put it in the correct place of the record to be written and update the record.

I hope this helps,
Jared
0 Kudos
Message 3 of 3
(2,839 Views)