In the beginning, God created the heavens and the Earth...
Perhaps I should skip forward a bit.
I am writing an application that has two parts: a client and a server. The client is a nifty little Access DB. The server is an asp.net application. The server application is on a web server, the client application is on laptops. I need to write an Access function that does this:
1) Set a value in a table to false.
2) start an invisible instance of IE and opens a web page. This web page has an asp.net function in its on load event.
3) The asp.net function attempts to set the value in the little client DB to true.
4) Then the MS Access function checks that table. It retrieves the value and returns it.
The purpose of this is to determine whether the user can interact with the asp.net application. If the test works, I start moving real data between the client and the server.
After posting yesterday, I found a crude way to make Access wait:
'Give asp.net a few seconds to change the test value.
Dim a As Date
a = DateAdd("s", 10, Now())
Do While a > Now()
Loop
I think that that will paralyze the user's laptop, but it will force Access to wait.
Stupid me to ask such question when I know nothing about ASP, well, the initial question was about a2k3, wasn't it;-)
Sooner or later this will barf - the process isn't finished when the next step of the function is performed - so with such "hardcoded waiting", you will need to do some testing/programming to circumvent that.
With other technologies, one could use something like the approaches here faq222-428, thread705-834235 (PHVs and CajunCenturions suggestions), which shells the process and wait for the process to finish. I wouldn't know a thing about if such would work in your setup, but I fear they will not.
Then, I'm wondering - if you automate IE, wouldn't there be some methods there to "catch" this load event? (I know nothing about that, either)
Then there's the method of for instance trying this from a modal form, using it's timer.
The code in the timer event would simply either open a recordset on the table where the Yes/No field resides, and test it, or if you bind the table to the form, test a bound control/recordsource field. I just did a smallish with something like that, which seemed to work on my setup - single computer)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.