Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macro substituion in views
Message
From
11/05/2000 16:24:26
 
 
To
11/05/2000 13:50:03
Peter Wagner
Point Informática Ltda.
Limeira, Brazil
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00368677
Message ID:
00368794
Views:
16
>*I'm trying to create a View for a Grid in a Form, but the View must show diferent types of information depending on option's chosen by user in another page of a pageframe.
>*Depending of the option, the view show's only data between dates and or from some departments, and so on.
>*The best way I found is to use macro substitution for the where clause in SQL.
>
>*I cant make it work because it return's the following message, Alias not Found, in this case the own View or column z not found.
>
>*But if I try it in an program just like an SQL statement it works fine, but I need a view to use it in a grid, and the same grid cant have different views.
>

A view won't do what you want, because the macro expansion occurs when the CREATE VIEW is executed; the macro is not resolved at the time the view is accessed. If you absolutely must have view access-time resolution of the WHERE or HAVING clauses, you'll have to rely on EVAL() for it.

An alternative might be to create the view you need in a temporary DBC just before it is needed; you'd use a temporary DBC because the DBC would bloat over time from multiple CREATE VIEW and DELETE VIEW sequences, and to allow several people to work with their own unique view definition at any given moment.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform