06-03-2009 06:26 PM
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
Solved! Go to Solution.
06-03-2009 07:44 PM
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
06-03-2009 08:47 PM
pawel,
Can you attach your VI or screenshot?
06-03-2009 11:50 PM - edited 06-03-2009 11:59 PM
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
06-04-2009 02:03 PM
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.
06-04-2009 02:54 PM
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
06-04-2009 09:00 PM
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.
06-05-2009 11:28 AM - edited 06-05-2009 11:30 AM
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
10-15-2009 08:52 PM
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.