LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fetch data from database

i use this sentence to get the data from my database, "select * from datalogging WHERE datalogging.utctstamp>15684000&datalogging.utctstamp<15686000",  i insert this sentence into labview DB tool execute query module and then use DB tool Fetchl recordset module from labview to get the data, however, the labview wait infinite time and then crashed. 

can somebody help me?

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

Hi,

I think the first sub-vi returns an error (Open connection).

There are 2 ways to connect to a database :

The easyest is to use a .udl file (search on your hard drive C:\, you will find a Labview.udl) This file will help you to connect you to database : there is a button to test connection, ant if this doen's success, it's useless to continue with labview... When ot works, link the path of this udl to the vi connecting to database.

The second way is to use a connection string (try to search SQL connection string on forum, you will find what it looks like), but I don't think omnihpposa is a good connection string.

 

Just an advice : when you use local variables (such as decimal integer string), you doen't assure data flow : your second query (datalogging) will execute with parameters of the previous recorset of the other database...

Best regards,

V-F
0 Kudos
Message 2 of 3
(2,518 Views)

Try changing the '&' in your query to the word 'AND'.  I tested a query in MS Access using both  approaches and the ampersand caused the engine to concatenate the search terms and it ended up querying a nonexistent field.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

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