No.1 Posted March 31, 2009 Report Share Posted March 31, 2009 Hi, all How can I stop the database(sql server) query before that finished in labview programmable? Thanks! Quote Link to comment
Rolf Kalbermatter Posted March 31, 2009 Report Share Posted March 31, 2009 QUOTE (No.1 @ Mar 29 2009, 10:41 PM) Hi, allHow can I stop the database(sql server) query before that finished in labview programmable? Thanks! By not using high level VIs but taking apart your query into at least an Execute query and the actual data retrieval. If you close the statement or result set reference before you actually retrieve the data, the query should be dropped and any already generated data with it. You probably need to find a way to see if the query already produced some data before starting the retrieval as it might not be possible to cancel an already started data retrieval. You can try it out however if closing the result set reference in another part of the code does maybe abort the data retrieval too. Rolf Kalbermatter Quote Link to comment
No.1 Posted April 1, 2009 Author Report Share Posted April 1, 2009 QUOTE (rolfk @ Mar 30 2009, 02:17 PM) By not using high level VIs but taking apart your query into at least an Execute query and the actual data retrieval. If you close the statement or result set reference before you actually retrieve the data, the query should be dropped and any already generated data with it.You probably need to find a way to see if the query already produced some data before starting the retrieval as it might not be possible to cancel an already started data retrieval. You can try it out however if closing the result set reference in another part of the code does maybe abort the data retrieval too. Rolf Kalbermatter Hi, Rolf Kalbermatter I think ADO ActiveX may have some method to stop the current query, for example, a property to set the timeout or a method to abort the current query. But I am not familiar about that. Quote Link to comment
Rolf Kalbermatter Posted April 1, 2009 Report Share Posted April 1, 2009 QUOTE (No.1 @ Mar 30 2009, 08:56 PM) Hi, Rolf Kalbermatter I think ADO ActiveX may have some method to stop the current query, for example, a property to set the timeout or a method to abort the current query. But I am not familiar about that. Neither am I. I use my own ODBC based VI library and ODBC does not know an explicit cancel method but you simply close the statement handle (a specific query or other SQL statment execution) with an option to force it. What that does on the server side is however quite a different story since it is ODBC driver specific. It could communicate the closing of the statement to the server and cause it to abort any ongoing activity on that statement but it could also just close the handle on the client side and let the server continue with whatever it is doing, eventually discarding any response from the server it gets for this particular statement. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.