Alan
I have not tried this myself but it should work.
lcFilter = 'MyField1=?Value1 AND MyField2=?Value2'
>I need to contstruct a remote view using a variable WHERE clause. The syntax I have used is CREATE SQL VIEW MyView CONNECTION MyConnection AS SELECT * FROM MyTable WHERE &lcFilter. lcFilter could be something like 'MyField1=Value1 AND MyField2=Value2'.
>
>When I USE MyView, I get the error "Connectivity error. Incorrect syntax near '&'." I also get this message if I change the view parameter to &?lcFilter.
>
>If I change the parameter to ?&lcFilter, the error message is "SQL parameter is missing".
>
>I have read on this forum that it is possible to use macro expansion in a view definition, so has anyone any idea what I might be doing wrong? How else can I set the WHERE filter at runtime for remote views? I am using VFP6/7 as a front-end to MSDE for development (SQL7 at client site).
>
>Any help would be appreciated.
>
>Alan Harris-Reid