Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird cursor behavior
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Weird cursor behavior
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
00971602
Message ID:
00971602
Views:
56
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
Next
Reply
Map
View

Click here to load this message in the networking platform