Running multiple async queries with ADODB - callbacks not always firing

后端 未结 3 561
时光取名叫无心
时光取名叫无心 2020-12-05 16:07

I have an Excel workbook that fires three queries to a database to populate three tables on hidden sheets, and then runs three \'refresh\' scripts to pull this data through

3条回答
  •  心在旅途
    2020-12-05 16:25

    I'm also not sure why the event does not always get fired for you.
    For me, the test always worked (tested with 100 000 rows and 14 columns), but I'm not sure about the size of your database and complexity of the queries that you are executing.

    I've got a remark though.

    There is an important difference between the ExecuteComplete and the FetchComplete Event.

    The ExecuteComplete fires after a command has finished executing (in your example, the command object is internally created by ADO). This does not necessarily mean that all records have been fetched by the time this callback fires.

    Hence, if you need the returned recordset to work with, you should listen to the fetchComplete callback, that only fires when the recordset was entirely fetched.

提交回复
热议问题