Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Parameterized View
Message
From
04/11/1997 17:28:09
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00057664
Message ID:
00058241
Views:
31
>
>I have a view with 4 parameters. If only one of the parameters has a value, what do I fill the other parameters with so that I get back records that match the one parameter I have? For instance, if my view parameters are vp_idnum, vp_last, vp_first & vp_middle and I only have a value in vp_idnum, how do I keep from getting back all the records in the table (because the other parameters have "")? Also, if vp_last contains only "A", how do I get back all records that have last name beginning with "A"?
>
>From the 'lv_' prefix I assume you are with Codebook <g>. There is a difference how your parameters are processed if you are working with remote or local views. Give a look at the GetViewParameters() method in cBizObjForm.
>
>José
>

>
>In general, if you have multiple view paramaters and you want to pull data from one parameter but not the others, just set the other parameters to Space(0). That should do it. As long as the variables are defined you should be ok.
>
>If you have vp_idnum defined and all the other view parameters are set to Space(0) you should get only those idnums. If you have the idnum=1 and vp_last = "A" then you should get all idnums = 1 and lastnames starting with 'A'. One thing you might want to check is the whether you have "AND" or "OR" joining your view parameters in the view designer.


With the connectors set to 'OR', when I set vp_idnum to a known value and all other parameters to SPACE(0), I get all records that have an empty middle name (middle name is the last parameter in the view definition). If I set the connectors to 'AND', I get no records. If I set the connectors to 'OR' and enter a valid value for vp_idnum, then set the remaining parameters to something I know doesn't exist in the data (ie. '*'), then I get back the one record I expect.
Previous
Reply
Map
View

Click here to load this message in the networking platform