Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Weird cursor behavior
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Weird cursor behavior
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Divers
Thread ID:
00971602
Message ID:
00971602
Vues:
59
Hi,

I have a form that is set to a private data session. In addition to tables and views that automatically load with the data environment, I programmatically create a cursor in the load event of the form, and attach this cursor as the rowsource for a list box. This cursor represents the results of a SELECT-SQL statement, which loads only a subset of the source table's records. The cursor is actually created through the SQL statement.

Everything works fine on the startup of the form. The list box displays the proper records. However, I also have a feature which allows users to automatically change the rowsource of the list box to a second cursor, which displays all of the source table's records in a particular order. Basically, I have a two button option setup, which allows the user to toggle back and forth between both cursors. The only catch is that the second cursor is not created until the user chooses to see that particular record view.

The problem is that when I create the second cursor and it replaces the first cursor as the list box's rowsource, the firt cursor seems to lose all of its data. In other words, the first cursor displays no records after it is removed as the rowsource. However, the second cursor never loses its data, even when temporarily removed as the rowsource.

To make this more even confusing, this behavior only occurs when the DataSession property is set to a private data session. Everything works fine when it is set to default data session. I may try using views instead of creating cursors for this particular form, but I'm still puzzled as to why this is happening. Any ideas what is going on?

Dave
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform