Hi Sanjay,
>hi,
> How can i execute a sql stored procedure with parameters from VFP?
>
> I have a stored procedure in sql server with 2 inputs parameters and 1 output parameter how can i execute & retrieve the value in output parameter from VFP. Is there a way to trap SQL or ODBC error msgs from VFP?
>
>sanjay.
I see you've been given alot of advice about trapping the error. To get the output parameter value back prefix the variable name with ?@. It can even be a local variable. I also 'seed' the variable with the proper datatype. For example, the following will execute my stored procedure to get a new Primary Key for a Claim:
local lnId, lnResult
lnId = 0
lnResult = SqlExec(g_oAppMain.nConnHdl, "Exec SpMc_GetNewId 'CLAIM', ?@lnId")
if lnResult < 0
...
HTH,
Bill Armbrecht
VFP MCP