Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Empty Grid
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00155119
Message ID:
00155262
Views:
36
>>Guessing here, but I've had the same experience. I've found that when the DE loads a cursor, it's indexes are known. Try removing the cursor object from the DE, indexing, then reloading the cursor back into the DE and setting your grids recordsource.
>
>a little off the subject, but ... how do you remove and then reload a cursor back into the DE in code? i have never been able to successfully manipulate the DE in code.
>
>thanks - brenda

Brenda,

Here's a method called .AddViewToDE that I use. It takes 2 parameters; the table or view name and whether you want data on load (for views). goDB is a database object which has the path name. You can just do a
THISFORM.DataEnvironment.RemoveObject(CursorName) to remove one.

*
* Adds a view or table to the DataEnvironment.
*
LPARAMETERS vcView, vlDataLoad
LOCAL loCursor

THIS.DataEnvironment.AddObject(vcView, "Cursor")
loCursor = EVALUATE("THIS.DataEnvironment." + vcView)
loCursor.Alias = vcView
loCursor.CursorSource = vcView
IF TYPE("goDB") = T_OBJECT
loCursor.Database = goDB.gcFullDB
ELSE
loCursor.Database = LOCFILE(THIS.gcDatabase, "DBC", "Find Database")
ENDIF
loCursor.NoDataOnLoad = vlDataLoad

RELEASE loCursor

Steve
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform