|
-
Sep 24th, 2002, 07:11 PM
#1
Thread Starter
Hyperactive Member
Waiting for an ADO Comand to complete
Hi team
I have an ADO command that writes across a slow network.
Later in the program I have to read that data. But sometimes the data is not there when I go to read it. If I pause execution manually and then continue, it's OK.
How can make execution wait until the command has completed?
Thanks
FW
-
Sep 24th, 2002, 07:23 PM
#2
Addicted Member
Check the State property of your command object. IE:
Do While CMD.State = adStateExecuting Or CMD.State = adStateFetching
' Pass time... perhaps DoEvents.
Loop
' Read the data here.
-
Sep 24th, 2002, 07:31 PM
#3
Thread Starter
Hyperactive Member
-
Sep 24th, 2002, 07:37 PM
#4
-
Sep 24th, 2002, 09:41 PM
#5
Fanatic Member
Hi Sheppe
I tried this before but it never worked with me, hehe
I have in a Form a rsWhatever.Sort and after this is done the sortorder should be correct. If I use .State as waiting-loop I never get the sortorder, but if i have after the .Sort command a line with an Msgbox then it works.
any ideas to that?
.... strange .....
nice greetings
Franky
-
Sep 25th, 2002, 11:06 AM
#6
Addicted Member
Re: Hi Sheppe
Originally posted by Franky
I tried this before but it never worked with me, hehe
I have in a Form a rsWhatever.Sort and after this is done the sortorder should be correct. If I use .State as waiting-loop I never get the sortorder, but if i have after the .Sort command a line with an Msgbox then it works.
any ideas to that?
.... strange .....
nice greetings
Franky
Sort has nothing to do with DB activity; it is a function of the recordset object. Typically, it shouldn't return until it's done sorting.
-
Sep 26th, 2002, 02:17 AM
#7
Fanatic Member
Come on Sheppe
... don't split hairs ......
You know anyway what I mean. It is of course a recordset-action.
(I will ask next time my solicitor to check that I used the correct words, hehe)
But still the problem is as I said. It looks like that it finish this first before it resume with the next programline, but it isn't so.
nice greetings
Franky
-
Sep 26th, 2002, 11:03 AM
#8
Addicted Member
Re: Come on Sheppe
Originally posted by Franky
... don't split hairs ......
You know anyway what I mean. It is of course a recordset-action.
(I will ask next time my solicitor to check that I used the correct words, hehe)
But still the problem is as I said. It looks like that it finish this first before it resume with the next programline, but it isn't so.
nice greetings
Franky
I'm not splitting hairs, I'm making a statement. I also told you what behaviour to expect; the Sort method should not return until it is done sorting. Perhaps I'm not understanding what it is you're asking for.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|