Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read / write cursors???
Message
From
06/11/1998 16:15:28
 
 
To
06/11/1998 16:11:33
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00155363
Message ID:
00155377
Views:
25
>>>>>>I want to ...
>>>>>>
>>>>>>- build a cursor containing a subset of the main table...
>>>>>>- populate a grid from the cursor...
>>>>>>- have the user make a change via a pop-up edit window...
>>>>>>- save the change to the original main table...
>>>>>>- have the grid (cursor) also reflect the change
>>>>>>
>>>>>>
>>>>>>I'm sure that this is an 'every day' kind of thing, but there are so many ways to accomplish this... I'm looking for suggestions...
>>>>>>
>>>>>>Thanks
>>>>>
>>>>>You should have generic method which will get table records into cursor (SELECT or SEEK/SCAN) and use this cursor as grid.recordsource, actually nothing more. It's important that cursor will carry all primary key fields from the table.
>>>>
>>>>That's what I'm doing but I must not be doing it right...
>>>>
>>>>The cursor is the recordsource for the grid... when I pop-up the edit window, I'm displaying the record from the *main table*, not from the cursor. I did this because I'm not sure how to get changes from the cursor back to the main table...
>>>>
>>>>THanks
>>>
>>>If cursor holds primary key field(s), then you can always SEEK in table too.
>>
>>But I'm updating the main table already ( it's displayed in the edit window ) so I'd locate the record in the cursor and update is as well?
>>
>>Thanks
>
>No, you may either call generic method (populating cursor) again, or just locate corresponding record in cursor and replace values there. However, normal way is going from buffer (cursor or view as Josh said) to table, i.e. you edit buffer values and then either replace values in table immediately ( or use view row buffering) or accumulate changes and move it to table as one transaction (or use view table buffering).

Yep, an updateable (and parameterized) view sounds the most promising. Could you stear me in the right direction?

I'm doing this in code... not visually, so I assume there's a CREATE VIEW command and do I need Buffermode set a certain way? I'm just trying to avoid the delays that experimenting always causes. Any help is immensely appreciated!

Thanks
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform