Running asynchronous query in MS Access

后端 未结 2 972
萌比男神i
萌比男神i 2021-01-24 06:38

I\'m trying to run some heavy queries asynchronously, but can\'t figure out how to do it for an .mdb file.

This is what I have so far:

 Dim wrksp As Work         


        
2条回答
  •  孤街浪徒
    2021-01-24 07:05

    I can speak about executing this things against a JET data source however I have used this against SQL server so it should work. The trick is to use ADO and fire the execute statement with the option adAsyncExecute. I don’t have the exact code to hand but here is a rough version off the top of my head

    Dim DbCon as ADODB.Connection

    Dim dbCmd as ADODB.Command

    DbCon.ConnectionString=”Your connection string”

    With dbCmd
    .commandtype= adCmdText

    .commandtext=”Your long SQL update statement”
    .ActiveConnection=dbcon

    .Execute , , adAsyncExecute

    End With

提交回复
热议问题