General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
First of all you must set AUTOOPENTABLE property of DE is .F. and add
code below in form LOAD EVENT
* --- Open data on dataenvironment
LOCAL lnCnt, loObj, lcDBC
LOCAL ARRAY laList[1]
*** Get Object Members of DE
=AMEMBERS(laList, THISFORM.DATAENVIRONMENT, 2)
IF !EMPTY(laList[1])
IF ALEN(laList,1) > 0
FOR lnCnt = 1 TO ALEN(laList,1)
loObj = EVAL("ThisForm.DataEnvironment." + laList[lnCnt])
IF LOWER(loObj.BASECLASS) = 'cursor' AND "\" $ loObj.DATABASE
IF !EMPTY(loObj.DATABASE)
*** Contained Table
lcDBC = upper(alltrim(loObj.DATABASE))
loObj.DATABASE = STUFF(lcDBC,1,AT([\XMANLITE],lcDBC) + 8,gcAppPath)
IF !DBUSED(loObj.Database)
OPEN DATABASE (loObj.Database)
ENDIF
SET DATABASE TO (loObj.Database)
ELSE
*** Free Table
lcDBC = upper(alltrim(loObj.CursorSouce))
loObj.CursorSouce = STUFF(lcDBC,1,AT([\XMANLITE],lcDBC) + 8,gcAppPath)
ENDIF
ENDIF
NEXT
ENDIF
Thisform.DataEnvironment.OpenTables()
ENDIF
* ----- Stop open data
Previous
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