LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"DB Tools Insert Data.vi" problem in LV 8.6

Solved!
Go to solution

 

 

Hi all,

 

Did anyone experienced a problem with the new "DB Tools Insert Data.vi" in LV 8.6?

 

It broke my method to save the variants to database (Jet4 engine, win XP, Office 2007) without any warnings.

 

Any ideas are most welcome.

 

Pawel

0 Kudos
Message 1 of 9
(3,942 Views)

Pawel,

 

From my experience it doesn't work with array input data.  I haven't tried with single item entry so not sure how far the "bug" goes.  I was attempting to use the data input type as a 1d array of strings.  I kept getting an error to the effect of data values count didn't match column count.  I ended up doing my own SQL statement and using the DB Tools Execute Query.vi

Troy
0 Kudos
Message 2 of 9
(3,934 Views)

pawel,

 

Can you attach your VI or screenshot?

0 Kudos
Message 3 of 9
(3,928 Views)

Hi

 

Here is the screenshot.

 

I am ragther sure it is when saving the data to the database because when saved with the older version (I do not know which LV though) the new one can read without any problems. The new and the old version do not differ at all. The only differnce is the new LabVIEW and new SQL toolkit.

 

The problem is with the only variant in that cluster "MeasData. When traced down to this function everything is OK and it propagates fine. But when read back from database it appears as a "non displayable" data. When run via the "database to data" variant conversion the error is reported that the data is invalid.

I also flattened it to string and compared with the properly saved data and the string is different completelly. So I am rather sure it is the new SQL toolkit or related thing.

  

If I do not find resolution to it I will have to install the old version of SQL toolkit, but I have already tried the 1.0.1 and it failed completelly. Probably the new LabVIEW is not cpompatible with the old SQL toolkit.  

 

thanks

Pawel

 

Message Edited by pawel on 06-03-2009 11:59 PM
0 Kudos
Message 4 of 9
(3,922 Views)

Hi pawel,

 

Does this happen in only this particular VI or all VIs using the DB Tools Insert Data.vi?  Does it occur in the simplest VI possible?  Could you attach that simple VI?  Thanks!

 

Kristen H.

0 Kudos
Message 5 of 9
(3,895 Views)

Hi Kristen

 

I attach two vi, one very simple and one working with arrays. Both use variant as an input and both do not work as you will see. 

 

Thanks for looking into this. I hope you find the way forward for me.

 

Pawel

 

 

Download All
0 Kudos
Message 6 of 9
(3,888 Views)
Solution
Accepted by topic author pawel

I tested the DB_test_simple.vi with MySQL database. The data can be inserted into the table. The error occurs when you convert the data into variant after querying it from database. See the screenshot. Database toolkit knows that variant refers to a I32 integer actually. If you look at that table after inserting, you will find column b is Interger type. So querying from that table will give you that data "10" as variant to I32, but not variant to variant. Change the input type to that Variant to Data.vi like the sceenshot, your VI will work well.

Message 7 of 9
(3,876 Views)

Hi NMeil

 

Thanks a lot, you are right. The older LV and DB toolbox was saving the data differently than the current release, that is the cause of the incompatibility which cost me head ache.

 

I hope the incompatibility will be removed in the later version because the solution I have right now is not pretty. I have to detect an error while converting from the old data already saved in the database and then use the direct type cast as you pointed out to convert to actual data and then back to the LV variant as this is the container I am using.

 

At least it works now and I hope will for some time.

 

thanks again.

 

Pawel

 

Message Edited by pawel on 06-05-2009 11:30 AM
0 Kudos
Message 8 of 9
(3,864 Views)

Hi all,

 

I have the same problem as pawel had (in that thread), i.e. cannot Insert or Update data in Access database. However, the reason is not that I am using some keyword in my field name - it's been many years using SQL, some things are "unwritten" rules. But this is the first time I am trying something in LV.

 

However, after losing the entire day for a job that I expected to do in 1 hour in the morning itself, trying many different options, and debugging upto the lowest level in Database toolkit VIs (stepping in and over) I saw some weird SQL statement being formed internally- so I tried what Troy has tried.

 

And even than it doesn't work. 
 
 
I would appreciate if anybody of you could take a look at it.
 
Thanks ahead! 
Vaibhav
0 Kudos
Message 9 of 9
(3,670 Views)