Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters using sql pass through function
Message
From
29/08/2002 17:28:26
Erik Lowery
Vartec Telecom, Inc.
Dallas, Texas, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Passing parameters using sql pass through function
Miscellaneous
Thread ID:
00695209
Message ID:
00695209
Views:
59
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
Map
View

Click here to load this message in the networking platform