>I am trying to make VFP work with MS-SQL 2000 is an easy way.
>I was creating new sql views for each set I needed returned and I have finally figured out how to use the ? to get my data variable.
>QUESTION - How do I pass a ordering variable to the view
>
>The error I get is
>Connectivity error Line1:
>Incorrect syntax near '@P2'
>
>mORDER = 'ORDER BY BRAND, CATEGORY, DESCRIPT '
>
>Create Sql View i_NEED Remote Connection EISI As ;
>SELECT Items.DEF_VENDPO, Items.ITEMNO, Items.CATEGORY, Items.BRAND,;
> Items.MODEL, Items.DESCRIPT, Items.CUSTCHAR5 AS size,;
> Items.CUSTCHAR6 AS color, Items.COST, Items.SELLPRIC, Items.QTY_STK,;
> Items.MIN_NEEDED, Items.AVG_BET_SI, Items.LIFE_Q_PR, Items.LIFE_Q_SI,;
> Items.Q_ON_ORDER, Items.Q_ON_RESER, Items.LPR_DATE, Items.LSI_DATE,;
> Items.MAX_BET_PR, Items.CUSTCHAR3 AS note, Items.CUSTCHAR4 AS yeardt,;
> Items.CUSTNUM1 AS slow, Items.CREAT_DATE, Items.ACTIVE, Items.WEB_ACTIVE;
> FROM items Items;
> WHERE category = ?mLOCATE;
> AND active = 'T' ?mORDER
Create the view in SQL without the order by clause. Then, when you query it in VFP, include it. You'd have to query it with SQL Pass-Through, you won't be able to do it with a VFP remote view.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.