Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to dynamic change filt cond and ordr of remote view
Message
From
12/02/2002 05:49:02
 
 
To
11/02/2002 10:44:48
Max Chen
Yx Software
Shunde, China
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00617483
Message ID:
00618726
Views:
21
Hi!

I just typed following in the command window:
create SQl VIEW Sample AS ;
    Select * from ListValues Where &?lcParam
lcParam = ".T."
use Sample
browse last && displays all records
use
lcParam = "list_id=1"
use Sample
browse last && displays only records for list_id = 1
HTH.

>Hi
>
>I'm sorry that i can got the remote view work after many time test.
>
>Would you please give me more direction if you got time ?
>
>max.
>
>
>
>>One of the cases for sure should work. Just check if you correctly pass expression in the parameter. For exmaple, when you need a query like
>>
>>SELECT ... FROM ... WHERE MyField like 'something*'
>>
>>You require to assign following to lcWhere:
>>lcWhere = [MyField like 'something*']
>>
>>HTH.
>>
>>>Hi
>>>
>>>There are both not working. Do you have other idea ?
>>>
>>>max.
>>>
>>>
>>>>Hi!
>>>>
>>>>Just try SQL SELECT for view with parameter like following:
>>>>
>>>>SELECT ... FROM ... WHERE &?lcWhere
>>>>
>>>>(I'm not sur it should be "&?lcWhere" or "?&lcWhere", but seems first option is more appropriate. Just try both and see which will work.)
>>>>
>>>>Then if you get all records, put a string ".T." into the lcWhere variable (parameter for query). When you need filtering, put the filtering expression as a string into the lcWhere. VFP expands macro in the parameter fro query and run query with it.
>>>>
>>>>HTH.
>>>>
>>>>>Hi!
>>>>>
>>>>>I'm sorry that i my expression is not correct....
>>>>>
>>>>>My wanted is, change the SQL of a view .
>>>>>
>>>>>I want to accept condition/order input of user, then change the view
>>>>>then simplely requery.
>>>>>
>>>>>Max.
>>>>>
>>>>>
>>>>>>Hi!
>>>>>>
>>>>>>I guess yes. Did you tried it on a simple test before implementing something really big? I know for sure that sorting order by index is maintained after requery(). Probably filters are maintained too. However, WHY you want to filter the view, when you can define it as part of the SQL Select statement for view, and just use requery()?
>>>>>>
>>>>>>>Is it prossible do this before launch requery() again ?
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform