>I need an updatable view in my application, for display in a grid on a page. That view is a sub-set of a single table, and can take one of three forms - either all records associated with a client, just those that are overdue, or just those associated with a single invoice.
>
>I'm wondering whether I should have all three views defined seperately in my data environment, or perhaps to just have one and modify it programmatically (I'm not sure how I would do that). Of course, I could also have a single view based upon the client number and then use a filter, but previous experience with filters made me suspect this would be too slow.
>
>Suggestions, please? Tho I have had years of VFP experience, this is the first application I'm writing that is not burdened by the 'old' methods of free tables (no DBC's) and 16-Bit compatibility - it's taking a little relearning to use DBC properties, triggers, views, etc.
>
>TIA
You could use parameterized view and change it on the fly :
create sql view myView as ;
select * from myTable ;
where Field1 = ?f1 ;
and Field2 = ?f2 ;
and Field3 = ?f3
store "" to f1,f2,f3
f1 = trim(thisform.text1.value)
f2 = trim(thisform.text2.value)
f3 = trim(thisform.text3.value)
requery("myview")
Of course you should take into account when to tableupdate etc.
Cetin