Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Requerying Grids
Message
 
 
To
06/03/1999 00:25:21
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00194339
Message ID:
00194891
Views:
27
Bonnie,

Views aren't really OOP they are more a data handling feature of VFP. They really are as easy to use as tables or cursors are. If the view is going to be updateable (allow them to edit the data) the table must have a primary key field and index. Almost every table I have now has an integer field for it's primary key. The value is generated by a Default Value entry in the Database container.

If the view is read-only then they are just as easy as the SQL selects you are using to generate cursors now. Views give you the ability to apply field mapping just like tables. There is an article on my website with a utility I use to copy table field level properties to views. Once you build a cbo class to handle your lookups you can map that class to the field (Tools, Options, Field Mapping) and every time you drag that table/view field out of the project manager or data environment your class will be used for the field. Your form designer productivity goes up by an order of magnitude.

There is an article on parameterized views on my website that gives you a real quick exposure to them.

>When I first posted the question, I was looking for quick answers using technology I already had a grasp of. I haven't had the opportunity to learn the use of views yet. The project that I'm working on is behind schedule and I needed to get them a semi-working beta today, so I was kinda under a bit of pressure :-)
>
>But now that I've delivered their precious beta, I can delve into some new concepts, at least for a couple of hours anyway before banging away at the app again. I'm planning on having to re-design a few things once I find better ways of doing this. I've been programming for eons, but OOP is still new to me.
>
>BTW, I finally did get it to work with the cursor by using zap and append from and so far it seems to work fine. But not optimal, I know. :-)
>
>Bonnie
>
>>Bonnie,
>>
>>You will save yourself a lot of headache and coding if you just switch from the cursor to a view. You can freely requery the view without causing your grid to self-destruct.
>>
>>>I can't seem to find a Requery method for grids, but it almost seems that I need to have such a method. I've got a grid based on two related tables, one of which is created in a form-scoped method with a SQL SELECT. When the screen is first activated, all is fine. But as soon as I call the method that re-creates the one table, the grid disappears ... it's obvious why this happens (because the table is deleted and then recreated) but now I need to know what to do about it. Any ideas anyone?
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Reply
Map
View

Click here to load this message in the networking platform