Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu is not visible after use showmenu() of menulib
Message
 
 
To
25/06/2008 05:36:37
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01325379
Message ID:
01326601
Views:
22
This message has been marked as the solution to the initial question of the thread.
>Hi Naomi.
>
>May be create new class based on Grid, insert my code in RightClick() and change class in my form?
>"Safe select" approach is good idea. Unfortunately not for me.
>
>Code of Andy Kramek:
>
>LPARAMETERS tcSql, tcAlias
>LOCAL lnSelect, lcSql
>*** Preserve Work Area
>lnSelect = SELECT(0)
>*** Cursor does not exist
>IF NOT USED( tcAlias )
>*** Create it directly
>lcSql = tcSql + " INTO CURSOR " + tcAlias + " READWRITE"
>&lcSql
I usually simply create my grid cursor in Form's Load method with CREATE CURSOR command. You can have variety of different options here - copy structure to array and create a cursor from array, would be one.

Or use a trick to make cursor read-write with USE DBF('myCursor') again in 0 alias MyReadWriteCursor, etc.
>ELSE
>*** Cursor does exist, use a safe select here
>lcSql = tcSql + " INTO CURSOR curdummy"
>&lcSql
>*** Clear and Update the woirking cursor
>SELECT (tcAlias)
>ZAP IN (tcAlias)
>APPEND FROM DBF( 'curdummy' )
>USE IN curdummy
>ENDIF
>*** Restore work area and return status
>SELECT (lnSelect)
>RETURN USED( tcAlias )
>
>not worked in VFP6!
>When I create cursor in SQL statement - it open with ReadOnly. And I must reopen it again.
>I don't know how in english (in russian dance with "buben").
>Thank you for interesting to my problem

I think you expressed this idiom correctly in English, but I doubt there is an exact expression here. I hope Dragan N (or Terry) will chime in with the good English idiom for this.

Anyway, good luck and hopefully perseverance pays at the end.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform