Why not write a program that accepts the parameter, runs sqlexec() and returns say a logical that tells if the operation was succesful. Something like:
PARAMETERS cState
LOCAl lcCommand, lnSQLConnect, lcCurAlias
lnSQLConnect = SQLConnect(...)
lcCommand = "SELECT * FROM Addresses WHERE State = '" + cState + "'"
lcCurAlias = "MYSQLCURSOR"
IF SQLEXEC(lnSQLConnect, lcCommand, lcCurAlias) = 1
IF RECCOUNT("MYSQLCURSOR") > 0
llResult = .T.
ELSE
llResult = .F.
ELSE
llResult = .F.
ENDIF
RETURN llResult
HTH,
Arriyel
>Is there a way to do this on the server side? So the view would have to accept a parameter to run.
>
>Thanks
>
>Jim
>
>>Declare a local (or private or public) variable. Assing it a value. Reference it in your select statemnt preceeded with a '?'. Like this:
>>
>>
>>local lcValue, lcCmd, liResult, liHandle
>>
>>lcValue = "TX"
>>
>>lcCmd = "select * from addresses where state = ?lcState"
>>liHandle = sqlconnect(...)
>>liResult = sqlexec(liHandle, lcCmd, "myAddresses")
>>
>>
>>>Hi All,
>>>
>>> I know how to set and pass a parameter to a view in Foxpro. Does anyone know if it is possible and/or how to do the same thing using SQL Server 7.0?
>>>
>>>Thanks
>>>
>>>Jim
Speak using soft and sweet words in case you have to eat them later.