NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Native error code -2147217887 0x80040e21 Microsoft OLE DB Provider for ODBC Drivers: ODBC driver does not support the requested properties.

I configured MySQL in TestStand and making a query in TestStand like this:
 
Command :=> "SELECT *  FROM crc_table ; " or  "SELECT CRC_Value  FROM crc_table ; " returns the total number of records without any errors.
 
But when I add the "where" clause
 
"SELECT crc_table.CRC_Value  FROM crc_table where crc_table.File_ID= Locals.File_ID and crc_table.Version_ID = Locals.Version_ID and crc_table.Link_ID = Locals.Link_ID; "
 
I get the error as:
 
Error, The following SQL command failed: 'SELECT crc_table.CRC_Value FROM crc_table where crc_table.File_ID= Locals.File_ID and crc_table.Version_ID = Locals.Version_ID and crc_table.Link_ID = Locals.Link_ID; ...' Native error code -2147217887 0x80040e21 Microsoft OLE DB Provider for ODBC Drivers: ODBC driver does not support the requested properties. [Error Code: -10, User-defined error code.]
 
I tried the same syntax in MySQL Query Browser and got the correct result:
 
SELECT crc_table.CRC_Value  FROM crc_table where crc_table.File_ID= "FID1" and crc_table.Version_ID = "VID1" and crc_table.Link_ID = "L1";
 
I would appreciate your help.

Thank you,
Vidula
0 Kudos
Message 1 of 3
(7,020 Views)

Vidula,

I am not completely sure if this is the cause of the error but it is something that will cause problems if it is not fixed.  In your SQL statement you must properly concatenate your strings with your variables.  In the statement you posted you were simply putting the variable names in the string, not actually pulling their values.  To do so properly your query should look something like this:

"SELECT crc_table.CRC_Value  FROM crc_table where crc_table.File_ID='"+Locals.File_ID+"' and crc_table.Version_ID = '"+ Locals.Version_ID+"' and crc_table.Link_ID = '"+Locals.Link_ID+"' ;"

This way we are using the values of the variables in conjunction with the text strings.  In this case the usage of single quotes (') casts the variables as strings so you may need to change this character sequence, but from the second example you gave I think that your variables are of type string so this should work fine.



Message Edited by herosphro on 04-01-2008 03:52 PM
John B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(6,986 Views)

John,

I added the single and double quotes combination but still it's not working.

In the Build SQL Select Statement window there is one example under the Where Clause, it's difficult to make out from that example how to write the where clause in TestStand.

Some sort of documentation will really help here.

Thanks,

Vidula

0 Kudos
Message 3 of 3
(6,963 Views)