LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW database error

Solved!
Go to solution

Hello

I have a weird problem with the database connectivity toolkit. The database im working with is SQL Server and its a Teststand result database (default SQL server setup).

 

I am browsing the tables going from one result ID and poking all data related to that result. This shouldnt have anything to do with the problem, but just as a background.

 

The query im trying to execute is:

SELECT * FROM ProductionTest.dbo.STEP_RESULT WHERE ID = '{E50482A2-1B88-11E7-913A-B8E856412CF9}';

 

It generates the error:

Error -2147217900 occurred at NI_Database_API.lvlib:Conn Execute.vi

Possible reason(s):
ADO Error: 0x80040E14
Exception occured in Microsoft OLE DB Provider for SQL Server: Conversion failed when converting from a character string to uniqueidentifier. in NI_Database_API.lvlib:Conn Execute.vi

 

I have had this error a few times before and its usually just a missing character or an extra blank added to the GUID. But this doesnt seem to be the case with the select statement above. I also run this on the UUT_RESULT table first, 102 times and it works like a charm. If i execute the query in SQL Server Management Studio it works perfectly. I have tried to remove the {}-brackets just to check, same result. If i run the query in a simple test VI it works as well. But when running it inside the larger structure i get the error above. When testing the working options i literally copy the select string from a probe window, so its the same query that runs. The query above goes directly into the DB Tools Execute Query.vi.

 

I dont disconnect the database between queries, its the same one running the 102 times (and some other queries etc) before the error occurs. It always stops at the same point and on the exact same query.

 

I have tried restarting the computer just to clear any weird behaviour.

 

Anyone seen something like that before? Should i disconnect/reconnect the database connection for some odd reason?

 

Thankful for input.

 

Best Regards,

Nimgaard

0 Kudos
Message 1 of 4
(4,628 Views)
Solution
Accepted by topic author Nimgaard

UPDATE:

Using a fresh database connection seems to work. But that it seems a bit strange having to connect/reconnect after a number of queries.

0 Kudos
Message 2 of 4
(4,616 Views)

Hello Nimgaard,

 

I will post in here some information about error -2147217900. 

 

Useful links. Please have a close read!

 

https://forums.ni.com/t5/LabVIEW/Error-code-2147217900-Typo/m-p/3263076#M951968

 

http://digital.ni.com/public.nsf/allkb/5554E9522328ECCB8625772F004DA5C1?OpenDocument

 

If you still encounter the error, let me know.

 

Kind regards,

Razvan 

 

 

0 Kudos
Message 3 of 4
(4,578 Views)

Thank you, but none of them was related to my problem. 

 

I have however got it working, and since its a small applikation i will let it be for the moment. Reconnecting seemed to help a bit, but im still a bit puzzled. Its likely some setting in SQL Server that i am missing.

0 Kudos
Message 4 of 4
(4,565 Views)