>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.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao