>I am having a problem with the SQLCANCEL function. I can't seem to get it to cancel the SQLEXEC function. Here's my code.
>
>WAIT "Executing Query, Please Wait..." WINDOW NOWAIT NOCLEAR
>SET ESCAPE OFF
>ON KEY LABEL ESC DO CANCELSQL
>mReturn = SQLEXEC(mHandle, msql, mcursor)
>ON KEY LABEL ESC
>SET ESCAPE ON
>WAIT CLEAR
>
>PROC CANCELSQL
> IF SQLCANCEL(mHandle) = 1
> WAIT CLEAR
> CLEAR TYPEAHEAD
> WAIT WINDOW "Report canceled."
> ENDIF
>RETURN
>
>What am I doing wrong?
I don't know that you are doing anything wrong. When you issue the SqlExec, control by VFP is lost until you get a return response back from the server. At least this is what my experience with Oracle. So, by the time your cancel code can execute, you already have a return value from the SqlExec, and the cancel becomes a moot point.
Mark McCasland
Midlothian, TX USA