Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Converting the Recordset Datatype

Primary Software: LabVIEW Toolkits>>Database Connectivity Toolset
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
I am using the Database Connectivity Toolset Fetch Recordset Data VI and would like to convert the 2-dimensional recordset data into a string, number, or other data type. How can I do this?

Solution:
Recordset data may be converted to any data type by using the Database Variant to Data VI, which is located in the Addons»Database on the block diagram. Place the Database Variant to Data VI inside two nested For Loops as shown in the image below.


Next, wire a constant of the desired data type into the type input at the top of the Database Variant to Data VI. In the image, a string constant has been wired to the type input.

The DB Tools Fetch Recordset Data VI outputs a 2-dimensional array of data type recordset. It must be wired into nested For Loops to break it down into its individual elements. Then, each individual element is converted into the desired data type using the Database Variant to Data VI. Finally, the desired data type is wired back outside the nested For Loops to build a 2-dimensional array of the new data type.

Related Links:
Products and Services: LabVIEW Database Connectivity Toolkit

Attachments:





Report Date: 01/10/2007
Last Updated: 04/08/2008
Document ID: 459E754G

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit