Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
Changing cursor properties in runtime
I have a method that changes the .Database property of Cursor objects in the Dataenvironment to point to the correct data folder, rather than my development folder. I have .AutoOpenTables = .F. for these dataenvironments, and do DataEnvironment.OpenTables() after setting the property. I have one form where the OpenTables() was giving me the "Object is not contained in a form" error, which I asked about in another thread. Searching help for insight, I found this:
"Note that setting a cursor object property at run time generates an error (with the exception of the Filter and Order properties, which can be set at run time). For a new property setting to take effect, you must call the CloseTables and OpenTables methods for the data environment."
I thought that I was solving this common problem in the right way. What is the right way to ensure that a DataEnvironment opens data from the correct folder and not from some copy? This code has always worked, except for this one form, and the error doesn't obviously point to this rule.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement