LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SQL refresh

I got a problem when I collect data from a MS Sql server database with the Database Connectivity toolset.

The data I get is not all correct.

I got these data

 

AdjustedQuantityPerExpanded   OrderQuantity   ComponentItemNumber   ComponentItemDescription     TotalQuantityRequired

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

But the correct data should look like this.

 

AdjustedQuantityPerExpanded   OrderQuantity   ComponentItemNumber   ComponentItemDescription     TotalQuantityRequired

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

3                                                         10                        60001929                             CONN SL M 4 LEADED            30

1                                                         10                        60001929                             CONN SL M 4 LEADED            10

I have made the two query'es in Access.

With the right one I have made a RefreshLinks before the query.

The question is, how do I make a refresh in Labvview ?

I found this link in a SQL forum, but I'm very good translate textbased programming to Labview.

http://support.microsoft.com/default.aspx?scid=kb;en-us;230588&Product=ado

Can anyone please help me ?Smiley Happy

Here is a picture of the funktions I use in labview

 

I use:

Labview 6.1

Database connectivity toolset 1.0.1

 

Best regards

Bjarne

Attachment SQLinLabView.JPG (34 kb)

0 Kudos
Message 1 of 3
(2,342 Views)

Hi Bjarne,

Can you upload your VI and database file so I can test it on my computer? I can see from the picture, that you are trying to fetch data from Column 1. I assume that column is "TotalQuantityRequired", you can try to give it the correct return type. You can also try to use "DB Tools Fetch Recordset Data" function instead.

There is a more detailed explanation of how to fetching data with SQL functions in Labview at Database connectivity toolset manual (Chapter 5):

http://digital.ni.com/manuals.nsf/websearch/F0E03761C7F4ACB486256A3E00509BA9?OpenDocument

 

I have also found a Labview .llb, where there is a Database update.vi that you might can use for your application:

Updating Data in a Database Table Using the Database Connectivity Toolset: http://zone.ni.com/devzone/cda/epd/p/id/3150

 

Best Regards

-----------------------------------------------------
Dennis Morini
District Sales Manager
National Instruments Denmark
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,324 Views)

Hi

I found the error and I am sorry to say that it was mistake of my own.

I thought it was in the SQL functions the problem was, because I got the same data when I used Access and solved that by making a "refresh links" in Access.

I found out that I got the right data in Labview, but my manipulation of data was infected with a bug

Best regards

Bjarne

0 Kudos
Message 3 of 3
(2,294 Views)