LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database Connectivity Toolset-Fetching Data from Database

Hello guys,

Currently I am doing some applications that include with database manipulation. The data that I am using now coming from Microsoft Access.

My Idea is to fetch the data from the specified table, specified column and specified row.... yeah we could do it using SQL query that we wrote on the Block Diagram...but that will be apply for the one condition that we set.

How about for the next time when we want to pull data from the same database but from different table/column/row using the same application..yeah we have to change the sql query

Why don't we use 'ring' in Front Panel to choose the database we want like to...

example

If we choose

Dominant = Right
Age = 25-34
Sex=Female
Weight= 50-69
Height= 175-184

Then the answer that will come out might be 78 in numeric indicator


So and the next time if I choose
If we choose
Dominant = Left
Age = 25-34
Sex=Male
Weight= 50-69
Height= 175-184

Then the answer will be 77 in numeric indicator...

So...my questions is simple....how to do it....have anyone here try to use ring to make selections in their database


I'll attach my empty applcation so that you all can see the Front Panel...and what exactly my Idea is...

TQ
0 Kudos
Message 1 of 2
(2,213 Views)
I couldn't look at your VI (7.0), but you can read (and change) the strings in a ring by using a property node.
To create one, right click on the control or the terminal and select Create>>Property Node. Then, click on the property and find Strings[] in the list. This is an array of all the strings in the ring. You can wire it, along with the ring value, into Index Array and you will get the string you chose.
You can now use this string to build your SQL query, no need for numbers and codes.

You can further customize this by using different strings for each field. For example, you can have one ring which will select the field, and based on that, another ring will now have only the values relevant to that field.
You can save these values in an array and that way have an unlimited query.

Correct me if I'm wrong, but don't the DB tools allow you to extract data directly (For instance, the DB Tools Select Data VI)? Shouldn't this allow you to extract all the info you need?

___________________
Try to take over the world!
0 Kudos
Message 2 of 2
(2,210 Views)