Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update table with grid and cursor
Message
From
16/04/2002 09:23:30
 
 
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:
00645413
Views:
10
Hi!

Select * from order where order_id=123 into cursor kk NOFILTER
USE (DBF("kk")) AGAIN ALIAS MyResultSet IN 0
USE IN kk
Thisform.Grid1.RecordSource="MyResultSet"

Anyway, it is better to use views, because changes you make in the temporary cursor will not be updated to the table automatically.

Create a view named "kk" with the query like "Select * from order where order_id=?param_order_id". Define the updating key (record id) and updatable fields, check "Send SQL Updates" checkbox and save the view.
Then your code for grid will look like following:

param_order_id = 123
USE kk IN 0
Thisform.Grid1.RecordSource = "kk"

The changes by user will be saved automatically to table when view is closed or tableupdate() command used or record pointer change.

To refresh the grid by another list using another order id, you will need just do following:

param_order_id = 321
requery("kk")
Thisform.Grid1.Refresh


Hope this helps.

>To All My dears,
>
>I want that I retrieve records, change and again save in table.
>
>Select * from order where order_id=123 into cursro kk
>Thisform.Grid1.RecordSource="kk"
>but the Control of Grid is ReadOnly
>now How I change the Record and again save in table.
>
>I m trying to last month on this website but I have no proper reply.
>
>thanks
>Khurram
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform