Mega Search
23.2 Million


Sign Up

Make a donation  
Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview

I am attempting to "Fetch Element Data" (FED) from an SQL table using the Database Connectivity Toolkit.  The data that's coming out is an array of numeric values (one column, length varies significantly).  I have wired an array constant (double precision numeric) to the type terminal on the FED block.  The variant coming out is wired to a "Variant to Data" vi with the same array constant connected to it's type terminal and an array indicator (also double precision) on it's output.  This is returning the error message listed in the subject block, which is undefined at this point.  I have had no luck with variant data conversion in the past, and have always found a way around using it.  It does not appear, at least to my rookie eye, that there is a way around using it now.  Can anyone advise me in the appropriate way to use variant data conversions or a better way to get the data I want?
 
Thank you,
Jason

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 19-Oct-2006, at 3:40 PM EST
From: kelljw31
 
Re: Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview
Mike,
Thanks for the recommendations, but I still have the same problem occurring.  I have tried changing the array to an array of strings, no luck.
 
Still befuddled in Bellefontaine...

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 23-Oct-2006, at 2:10 PM EST
From: kelljw31
 
Re: Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview
I can see the VI you speak of in the pallette, but it will not let me put on a block diagram.  I tried opening a blank vi and placing on the block, but that didn't work.  I looked it up in help so that I could place it on the block diagram from there, but it didn't give me the option.  I have all the latest software installed, including the toolkit.
Am I just not holding my head in the right position or something?

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Oct-2006, at 11:10 AM EST
From: kelljw31
 
Re: Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview
Mike,
Thanks, I did reinstall and can add the Database Variant to Data function to my block diagram now.
I am wiring an array of strings as the type and still have an error.  Error 91 occurred at Database Variant To Data in Variant2Data.vi; "LabVIEW:  The data type of the variant is not compatible with the data type wired to the type input."  If I wire a single string, the vi runs and returns a single value but I am looking for multiple values to come back.  Any suggestions on what I can do to get to where I want to be?
I have attached the vi I am working with.
Jason


Variant2Data.vi:
http://forums.ni.com/attachments/ni/170/212876/1/Variant2Data.vi

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 30-Oct-2006, at 9:10 AM EST
From: kelljw31
 
Re: Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview
Crystal,
I have attached a print screen of the SQL table design and the vi I use to write to this table.  If I convert to a string and not an array, it works but it only pulls back one piece of data, the first piece.


SQLDesign.JPG:
http://forums.ni.com/attachments/ni/170/213959/1/SQLDesign.JPG


WriteResults.vi:
http://forums.ni.com/attachments/ni/170/213959/2/WriteResults.vi

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 6-Nov-2006, at 10:10 AM EST
From: kelljw31
 
Re: Error -2147352571 occurred at Variant To Data  
News Group: comp.lang.labview
Sorry I've not replied sooner, I've been traveling and was really busy.  I noticed that when I looked at your table definition and then looked at your INSERT statement, there were a number of inconsistencies.  For example, you specify in the INSERT eleven fields to insert into but only give ten parameters.  Also, those ten parameters do not agree with your datatypes in the table definition.  Strings have the quotes around them, but numbers don't and I notice that for a couple of the string fields, you don't put quotes and for some of the numbered fields, you do put quotes when they aren't needed.  This confusion with the field types could lead to the problems you are seeing trying to convert the data back.  
Did you first try reading the whole table and converting to strings?  This might show in better detail which fields are which and how they are converted correctly.  You could also attach an example table with the fields you are reading and the VI that reads it.  But I do think at some point you are getting string and numeric fields mixed up at some point.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 20-Nov-2006, at 12:40 PM EST
From: Crystal