General information
Title:
Passing parameters using sql pass through function
I am looking for the proper syntax in VFP a SQL-pass-through function (sqlexec)to pass a parameter called AuthCode to a SQL stored procedure called COPS_CHECK_USABLE_AUTHCODE. The stored procedure's output is @Result (1 or -1) and @Error_Message. I need to pass the Error_Message back to the form in VFP and display it in a text box called Error_Message. Below is the syntax that I am trying to use. Any assistance would be appreciated.
Local AuthCode as char, ;
Result as int, ;
Error_Message as char, ;
AcctPoolType as char;
Result = 0
Error_Message = ""
AcctPoolType = ""
AuthCode = thisform.authcode.value
SqlConnectionString = 'DRIVER=SQL Server;SERVER=VTCORP;DATABASE=CORP;uid=mktuser;pwd=tariff'
STORE SQLSTRINGCONNECT (SqlConnectionString) TO ConnectVtcorp
sqlsetprop(ConnectVtcorp, 'asynchronous', .T.)
?ConnectVtcorp
lnResult = sqlexec(connectvtcorp, '{exec COPS_CHECK_USABLE_AUTHCODE (?@Result output, ?@AuthCode, ?@AcctPoolType, ?@Error_Message output)}')
?lnResult
thisform.Error_Message.value = Error_Message
?sqldisconnect(lnResult)
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only