Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where can i place code in form class instead of DE
Message
De
16/04/2001 23:09:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00493633
Message ID:
00495995
Vues:
19
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform