Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I retain current record in a remote table
Message
From
19/01/2005 12:07:38
 
 
To
17/01/2005 14:26:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00977803
Message ID:
00978609
Views:
42
>I have a view/input form populated by SPT code. When the form displays an index is created on the last name field and that order is set. I scroll to the record I need to edit. I run SPT edit code on my updateable fields. I issue the Use command and close tables. I then issue code to Use the original table again so my form fields can get the proper data. However, the record on the form and the record with the pointer in the table are not the same. If I refresh the form it displays the first record in the table. How can I get back to the record I originally was editing? I have a primary field that holds the user ID. This is what my SPT updateable code uses.

Two different ways:
1) If you have a PK, you can capture it's value at update and then locate it again on reload. That may be the simplest way.

2) You can avoid the issue by making the cursor updatable. It takes some work as you need to set the following via CURSORSETPROP: KeyFieldList, SendUpdates, UpdatableFieldList, UpdateNameList.

Do you really need to build an index? It might be better to add an ORDER BY clause to the SPT string.

Just some quick ideas.
Dan LeClair
www.cyberwombat.com
SET RANT ON - The Wombat Blog

Life isn’t a morality contest and purity makes a poor shield. - J. Peter Mulhern
Disclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.
Previous
Reply
Map
View

Click here to load this message in the networking platform