Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters using sql pass through function
Message
 
 
To
29/08/2002 17:28:26
Erik Lowery
Vartec Telecom, Inc.
Dallas, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00695209
Message ID:
00695265
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
lnResult = sqlexec(connectvtcorp, ;
      'EXEC COPS_CHECK_USABLE_AUTHCODE ?@Result, ?AuthCode, ?AcctPoolType, ?@Error_Message')
Notice, that the output parameters are passed by reference.


>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)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform