Jump to content

Stop Query


Recommended Posts

QUOTE (No.1 @ Mar 29 2009, 10:41 PM)

Hi, all

How 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

Link to comment

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.

Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.