Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Immadiate terminating of an SQL command
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00047916
Message ID:
00048074
Views:
23
This is a correction to PROC OnEsc
...
>IF lcOption $ "Yy"
> RETURN TO myproc && instead of xx
....
Sorry.


>Bela,
>You don't have to Cancel the execution of the program to stop the SQL select.
>Try this:
>Put the following code in a PRG and run it. Either way it will return the control to myproc. The difference is that RETRY will branch back to the SQL statement and RETURN TO myproc will return to the line following the SQL statement. Of course, the code below can be improved:
>
>*PROC myproc
>*************************
>ON ESCAPE DO OnEsc IN myproc
>** Your SQL SELECT statement here
>WAIT WINDOW "This is the line following the SQL statement"
>RETURN
>
>*************
>PROC OnEsc
>*************
>lcOption = ""
>WAIT WIND "Stop process ?" TO lcOption
>IF lcOption $ "Yy"
> RETURN TO xx
>ELSE
> RETRY
>ENDIF
>RETURN
>
>HTH
>Sorin
>
>
>>Hi Barbara!
>>
>>Thaks for your answer. Yes you are right, and I was a fool. But first I tried the way, that you wrote, the SQL statement was not terminated. Because, all the VFP documentation said, that issuing the Retry statement will continue the execution of last statement, but nowhere there was documented, that only an explicit Cancel will stop it. So this was my failure. After long trying, I get this:
>>
>>on escape do myproc
>>
>>procedure myproc
>>if <>
>> Retry && or nothing
>>else && in case of cancel
>> Cancel
>>endif
>>endproc
>>
>>
>>BB
>>
>>>>Hi everybody!
>>>>
>>>>Do anybody know a way with there can be terminate a long SQL select, if the user press ESC or click on a PushButton?
>>>>I thought on a dummy function which checks user input in SQL command, but what is the command, which terminate the SQL select?
>>>>
>>>>select *, dummy() ...
>>>>
>>>>function dummy
>>>> if
>>>>
>>>> endif
>>>>return .f.
>>>>endfunc
>>>>
>>>>TIA
>>>>
>>>>BB
>>>
>>>Bela, just using the Escape key will stop an SQL-Select if you have SET ESCAPE ON. Just set this to ON before the SQL, and re-set to OFF afterwards if you usually have ESCAPE set to OFF.
>>>
>>>HTH
>>>Barbara
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform