For Some reason I can't reply to any message lower than this one?
Thanks for the code... I will have to work something out maybe in the destroy event for clearing out indexes etc.
Will
Ok, I see. Here's what I'm using in my grid's base class:
*-- grid.Init()
*-- open cursor in Read-Write mode so that we can add index tags
=CursWrit(This.RecordSource)
* Program...........: CURSWRIT.PRG
*) Description.......: Re-opens a CURSOR created with SQL in read-write mode.
*) : RETURNs .t. if successful
* Calling Samples...:
* Parameter List....: tcAlias - optional CURSOR ALIAS
* Major change list.:
*--------------------------------------------------------------------------------------------------
LPARAMETER tcAlias
*-- check parameter. If omitted, default to currently selected ALIAS()
IF TYPE("tcAlias") <> "C" OR EMPTY(tcAlias)
tcAlias = ALIAS()
ENDIF
IF USED(tcAlias)
SELECT (tcAlias)
LOCAL lcDbf
lcDbf = DBF() && get handle to CURSOR
lcTempAlias = "A" + SYS(3) && temp name
USE (lcDbf) AGAIN IN 0 ALIAS (lcTempAlias) && open temp cursor in read-write mode
USE (lcDbf) AGAIN ALIAS (tcAlias) && re-open CURSOR with original ALIAS
USE IN (lcTempAlias) && close temp cursor
RETURN .t.
ELSE
*-- ALIAS not in use
RETURN .f.
ENDIF
Will Jones