LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Database: Read all data.vi - mix-up original database order

Hi ,

 

I used the Read all data.vi as an example to build my program. I could read the entire access database withouth any problem, although looking more careful I saw that the lines were mixed-up, i.e., the example is not placing data in the table with the same sequence as is in the database

 

In the screenshot attached, I used the original example, which reads the Labview.mdb, and the behaviour it's the same: Anne and Steve are in reverse order (look to labview table and access table). In the "Tools fetch table data. vi", I put a prove wire after "Database variant to data" [green circle], and the conclusion is that data is mixed-up inside that block.

 

Can anyone tell is this is the correct behaviour of this example?

 

Thanks 🙂

0 Kudos
Message 1 of 4
(2,992 Views)
I think Access is just sorting the data. Column one by ascending order. Remember, Access is not the database. It is an application program for queries into the Jet database. The LabVIEW program is just fetching the data and what LabVIEW is displaying is probably the order in which the entries being made. There is no auto-number column so it is impossible to really tell. It really doesn't matter in this case. If you want the data sorted, you need to use the ORDER BY command (SQL syntax) or use the sort functions in LabVIEW. If you want a table where you need to know the exact order in which entries were made for some reason, you need to design the table to accomadate that.
Message 2 of 4
(2,970 Views)

Hi Dennis,

 

thanks for your reply.

 

  • ["...is displaying is probably the order in which the entries being made."] - In my particular case, entries are inserted one by one, at a specific date and time (*.jpg attached). 
  • ["...ORDER BY command (SQL syntax)"] - How can this be done? I need to investigate this solution :).
  • ["...use the sort functions in LabVIEW"] - I would like to avoid this solution, because I'll have lot of entries, and sort this will take a long time (???).


The main goal isn't to show the result in a table, but showing the results in a graph, where the user has the capability of selecting the data in a specific time interval ( I only get the error when I saw data displayed in the graph 😞 ).

 

 Many thanks once more for you help :).

 

0 Kudos
Message 3 of 4
(2,958 Views)
Here is the ORDER BY syntax. I don't know which will be faster. Using the ORDER By will affect the time it takes for the query to complete. Doing the sort in LabVIEW will affect the time it takes to display the data once the query completes.
0 Kudos
Message 4 of 4
(2,950 Views)