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 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!