Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filtering a local view.
Message
 
 
To
27/09/2000 09:17:05
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00420901
Message ID:
00421972
Views:
23
>Thanks Larry:
>
>Are you referring to as a parameterized view created using SQLPREPARE() and SQLEXEC()?
>
>If yes, I can not seem to get a positive connection handle at the initial SQLCONNECT(). My database name is AMS.dbc and my table is Customer_Ship_To.dbf. I don't have any passwords or anything set up.
>
>If no, can I set up parameters in the Query Designer?
>
>Thanks again

SQLPREPARE() and SQLEXEC() are used to setup queries on remote data. In other words, data accessed not via the VFP database engine but through (in VFP 6's case) ODBC. It is not meant for use with local views and queries.

You can do this in the View Designer. On the Filter tab of the Designer, you can specify the criteria the view will use to retrieve data. To make the view parameterized, precede the value in the Example column with a ?. This will designate that the example is a variable and should be evaluated when the view is opened or requeried.
Ex.
Field Name         Not Criteria       Example
MyTable.MyField            =          ?cVariable
Before you open the view or requery the view, declare the variable, set it to the appropriate value and then access the view.

Ex.
cVariable = 'Somevaluehere'
use mydbc.myview

and later if you want different values returned in the view

cVariable = "SomeOtherValue"
select myview
=requery("myview")

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform