Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro expansion of view parameter
Message
From
20/07/2003 16:44:21
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
 
 
To
20/07/2003 16:04:41
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00811862
Message ID:
00811866
Views:
13
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform