General information
Category:
Coding, syntax & commands
>>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only