Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update table with grid and cursor
Message
 
To
16/04/2002 07:55:34
Khurram Khan
Filtrona Pvt Ltd.
Karachi, Pakistan
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00645360
Message ID:
00645377
Views:
7
Khurram,

Cursors created with SELECT are by default read only. In VFP 7 you can make then readwrite by using the READWRITE option of the INTO clause. However, although using the READWRITE clause will allow the cursor to be written to, it does not cause any changes to be written back to the original table.

To get truly updatable cursors you must use a view. You can create the view in the databse designer using the view designer and make it a parameterized view so you can supply the customer number as in your example. The view can be made updatable, meaning changes made to the view can be automatically written back to the original table. You can also read about the CREATE VIEW command in the help file (but there is considerably more to creating an updatable view than that command alone).

You might be best servered to not use select for this purpose, instead use the table directly.
IF NOT USED("Customer")
   SELECT 0
   USE Customer ORDER Custno
ELSE
   SELECT Customer
   SET ORDER TO Custno
ENDIF

SEEK "123"

... now just edit the fields and they will be changed.
Previous
Reply
Map
View

Click here to load this message in the networking platform