General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
I'm using this function and works very well.
Example:
Select * from myTable;
into cursor curTest
EditCursor()
or:
EditCursor("curTest")
************************************************************
* Torna editável um cursor gerado pelo comando SELECT-SQL
************************************************************
FUNCTION EditCursor
LPARAMETERS lcCursorAlias
LOCAL lnWorkArea, lcTmpDbfName, lcTmpCur, lnCurArea
IF Parameters()=0
lcCursorAlias = Alias()
ENDIF
lnCurArea = Select()
SELECT (lcCursorAlias)
lnWorkArea = Select(0)
IF At( ".TMP", Dbf() ) > 0
SELECT 0
lcTmpDbfName = Dbf(lcCursorAlias)
USE (lcTmpDbfName) AGAIN
ELSE
SELECT * FROM ( Dbf(lcCursorAlias) );
INTO CURSOR lcTmpCur ;
WHERE .T.
lcTmpDbfName = Dbf( "lcTmpCur" )
ENDIF
USE (lcTmpDbfName) AGAIN IN (lnWorkArea) ALIAS (lcCursorAlias)
USE
SELECT (lnCurArea)
RETURN
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only