>An OUTPUT parameter and a return value are two seperate things. Generally getting values back from an SP you use an Output parameter reserving the RETURN value for error handling. I have to admit, since in VFP you can't get access to the return value without using ADO, I never use it.
>
Hi Bob,
Generally I'm with you on using OUTPUT parameters for passing data back to VFP. But just FYI, you can get the SP return value with SQL Passthrough using code like the following:
#DEFINE CRLF chr(13)+chr(10)
=SQLEXEC(nConnectHandle, ;
'DECLARE @ret int' + CRLF + ;
'EXEC @ret = MySQLSvrStoredProc' + CRLF + ;
'select @ret as nResult','ResultAlias')
You can then retrieve the return value from the cursor returned. Vlad Grynchyshyn supplied me with this code methodology and I use it quite oftern to get the return value which usually holds any error parameter in my SP's.
Bill
William A. Caton III
Software Engineer
MAXIMUS
Atlanta, Ga.