Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where can i place code in form class instead of DE
Message
From
16/04/2001 23:09:01
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00493633
Message ID:
00495995
Views:
20
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
Map
View

Click here to load this message in the networking platform