Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not possible to scan dataenvironment objects!?
Message
From
24/06/1999 07:24:41
 
 
To
23/06/1999 19:46:25
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00231556
Message ID:
00233397
Views:
38
Wes,
than you for the code.

I have autoopentables=.t.
Can I put this code to Beforeopentables event so I don't
need to change autoopentables?


>>I have forms with tables in their Dataenvironment.
>>At form design time, VFP stores relative path of those cursors into cursor CursorSource. property
>>
>>I need to change CursorSource property because at run-time, files are at different locations.
>>The only reasonable place to do it seems to be BeforeOpentables event.
>>However, it is not possible to loop through cursors: dataenvironment does not have objects collection and cursor object names are changed.
>
>
>Here is a way to achieve kind of what you want in the form LOAD event.
>If allows you to walk down the cursor tree using AMEMBERS.
>You can then experiment with setting the various values of each
>cursor property.
>
>
>loData = THISFORM.DataEnvironment
>lnCursorCount =AMEMBERS( laCursor , loData , 2 )
>
>IF loData.AutoOpenTables = .T.
> MESSAGEBOX("Please set form to AUTOOPENTABLES = .F." )
> RETURN .F.
>
>ENDIF
>
>***************************************************************************
>*&& If there are no cursors in the class dont go any further
>***************************************************************************
>
>IF lnCursorCount = 0
> lvReturn = loData.OpenTables()
> && FIRE OPENTABLES EVENT TO SYNC DATAENVIRONMENT
> RETURN .T.
>ENDIF
>
>
>
>FOR lnCount = 1 TO lnCursorCount
> loCursor = GETPEM ( loData , laCursor(lnCount) )
> lcBuffer = loCursor.database
>
> && YOU NOW HAVE A POINTER TO THE CURSOR AND CAN ALTER VARIOUS SETTINGS
>
>
> loCursor = .NULL.
> lcDatabase = ""
>
>ENDFOR
>
>&& FIRE OPEN TABLES MANUALLY
>lvReturn = loData.OpenTables()
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform