Ask a questionAsk a question
 

QuestionCancelling a Query?

  • Sunday, October 05, 2008 10:58 PMturquoiseowl Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I am trying to get working the cancelling of queries using the ICommand::Cancel OLE DB method in a desktop configuration of Sql Server Compact SP1, with little (no) success.

     

    The Sql Server Compact 3.5 SP1 docs claim that the ICommand interface is fully supported by the OLE DB provider; calling ICommand::Cancel on a command object while a lengthy query is running on another thread returns S_OK (not DB_E_CANTCANCEL) suggesting the query will be cancelled; but the query continues on its merry way eventually returning a valid rowset (and NOT returning DB_E_CANCELED). Effectively, calling Cancel has no effect.

     

    I'm pretty sure I'm doing everything according to spec. but I've never got this working with any provider. Jet4 didn't support it; I've heard the full Sql Server provider does support it but have yet to get round to that one.

     

    It would be good to hear from anyone who has got this working and can help me with this please. Or, if it isn't actually possible, acknowledgment of the fact.

     

    Many thanks.

     

    Rgds

    Martin Connell

All Replies

  • Tuesday, October 07, 2008 5:44 AMRajagopal RavipatiAnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    This is a dummy API. It should be returning E_NOTIMPL. We will log a bug and get it fixed.

     

    Thanks

    Raja

  • Tuesday, October 07, 2008 8:48 AMturquoiseowl Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Thanks for that Raja.

     

    But before you dismiss the API, please could you consider implementing ICommand::Cancel. It is vital to a professional user experience that the user is given the ability to cancel lengthy operations, as you will know.

     

    Or is there an alternative method?

     

    Rgds

    Martin Connell