MViControl Posted October 12, 2010 Report Share Posted October 12, 2010 Hi all, When I use NI data connectivity toolkit to search database , I plan to use a multi list box (as a table) to display the seach database results, but I found the default output of the earch is a 2D variant array. How can I display the contents in a multi list box? Thanks Quote Link to comment
SuperS_5 Posted October 12, 2010 Report Share Posted October 12, 2010 The variant can be coerced to a string, or other data type if known. Data types can be pulled from the database if absolutely required. 1 Quote Link to comment
Francois Normandin Posted October 12, 2010 Report Share Posted October 12, 2010 Hi all, When I use NI data connectivity toolkit to search database , I plan to use a multi list box (as a table) to display the seach database results, but I found the default output of the earch is a 2D variant array. How can I display the contents in a multi list box? Thanks You can convert variant to string and display the result in the MCL. I have a small utility VI to help... 2D Variant to MCL.zip 1 Quote Link to comment
Phillip Brooks Posted October 12, 2010 Report Share Posted October 12, 2010 If you have a valid connection reference, use the DB Toolkit vi located at: vi.lib\addons\database\Auxilliary.llb\DB Tools Select All Data.vi This vi returns a 2D array of string that you can write to the ItemNames property of a MCL or the Values of a table control. If you have a recordset reference, you can use the sub-vi inside the one above called vi.lib\addons\database\Auxilliary.llb\DB Tools Fetch Table Data.vi No special coding or libraries required. You can use the VIs NI gives you (they are not on the palette though ) 1 Quote Link to comment
MViControl Posted October 13, 2010 Author Report Share Posted October 13, 2010 (edited) Thanks buddy, all of your answers did help me a lot! Edited October 13, 2010 by Techie Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.