>Thanks for the response. The view designer allows me to do it very easily, but what about when running a program which needs to define its view parameters based on user selects. Specifically, to direct the query to certain tables and links between them may also vary, again based on user request.
>Otherwise, I would have to define 3 times 14 times 365 times 10 = 153K remote views with view designer and that without restricting access for specific fields.
You create a parameterized view, where the parameter is variable:
create sql view my view as select * from mytable
where field1 = ?cValue1 and/or field2 = ?nValue2 order by something
use myview nodata
* user enters search parameters
local cValue1, nValue2
cValue1 = upper(alltrim(thisform.textbox1.value))
nValue2 = thisform.textbox2.value
requery('myview')
The view query is optimized if you have an index tag on field2 and an index tag on upper(field1).
If you need more flexibility than that, then you would need to create a USER database locally when the user launches your app, then create the views on the fly as needed.
Mark McCasland
Midlothian, TX USA