Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering a local view.
Message
 
 
À
27/09/2000 09:17:05
John Vlahos
V I Software Solutions Design
Mississauga, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00420901
Message ID:
00421972
Vues:
21
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform