>Hello,
>
>I have complex query which runs more than 30 seconds on SQL server.
>When I'm processing this query from VFP, program stops responding until results were returned.
>I saw that it's possible to use SQLEXEC asynchronously, but didn't find good article how to use it.
>Can anybody send me a link to resource where it is possible to read about using SQLEXEC asynchronously with examples.
>
>Thanks in advance.
On top of my head
SQLSETPROP(sqlHandler, [Asynchronous], .t.)
IF SQLEXEC(sqlHandler,....,[crsCursorThatReceiveResultSet]) < 0
AERROR(laError)
MessageBox([Query can not be ran ]+laError[1,2])
SQLSETPROP(sqlHandler, [Asynchronous], .f.)
RETURN
ENDIF
....
IF NOT USED([crsCursorThatReceiveResultSet])
RETURN
ENDIF
SELECT crsCursorThatReceiveResultSet
GO BOTTOM
....
Don't forget to reset back [Asynchronous] for this sqlHandler.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.