Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Search for views in data environment
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00158854
Message ID:
00158879
Views:
17
Hi Victor:

The following VFP6 code goes through a DE and determines whats a view and whats a table or cursor. I guess you could loop through forms by looking for SCX files using AFILES and then using CREATEOBJECT to launch an instance of each form.
LOCAL nDEOCount,iCounter,lUpdateable
THIS.FormCursorCount=0
THIS.FormViewCount=0
nDEOCount=AMEMBERS(aDEObjects,THIS.DataEnvironment,1)
FOR iCounter=1 TO nDEOCount
   IF aDEObjects(iCounter,2)="Object"
      WITH EVAL("THIS.DataEnvironment."+aDEObjects(iCounter,1))
         IF .BaseClass= "Cursor"
            THIS.FormCursorCount=THIS.FormCursorCount+1
            THIS.FormCursors(THIS.FormCursorCount,1)=.Alias
            IF CURSORGETPROP("Buffering",.Alias) < 2 OR .ReadOnly
               lUpdateable=.F.
            ELSE
               lUpdateable=.T.
            ENDIF
            THIS.FormCursors(THIS.FormCursorCount,2)=lUpdateable
            IF CURSORGETPROP("SourceType",.Alias) < 3
               THIS.FormViewCount=THIS.FormViewCount+1
               THIS.FormViews(THIS.FormViewCount,1)=.Alias
               THIS.FormViews(THIS.FormViewCount,2)=lUpdateable AND ;
                    CURSORGETPROP("SendUpdates",.Alias)
            ENDIF
         ENDIF
      ENDWITH
   ENDIF  
ENDFOR
RELEASE aDEObjects
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform