Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a SQL Server stored procedure
Message
From
07/03/2001 03:28:48
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00482118
Message ID:
00482607
Views:
15
Hi..Ricardo.
I have recd lot of replied and have got success but after HARD WORK. I will share my code and work with all on the forum. The code below is a procedure i have written in VFP procedure file and i am calling this from my form whenever i want to add a GROUP to my SQL SERVER group table.

Procedure AddGroup
Lparameter cGroupName, cDependGroup

Set UDFPARMS TO reference

nConn = Sqlconnect("acc")
RetValue = ''
cGroupName = Proper(cGroupName)
cDependGroup = Proper(cDependGroup)
Pass=.t.

=SQLSETPROP(nConn,'BatchMode', .f.)
=SQLSETPROP(nConn,'Asynchronous', .f.)

If SQLEXEC(nConn, 'exec Insert_In_Group ?cGroupName,?cDependGroup,?@RetValue' ) < 0
=Messagebox("Group Not Added",64+0,"Warning")
=AERROR(cm)
Pass=.f.
Endif

=Sqldisconnect(nConn)
Return iif(RetValue='NO',.f.,Pass)


I am having little problem in error trapping...Though =AERROR(cm) does trap error but the dialog box from RAISERROR keeps appearing...i want to suppress this (backend) dialog box ....and want to display the error message through VFP....any idea how?




>Hi Sanjay,
>
>Check out message #305201
>Michael Levy explains how to work with RAISERROR.
>
>As i said, i never used output parameters. I have another way to get around that. Send me a little piece of code of your SP (stored Proc).
>
>Ricardo


Ricardo there maybe other ways to get the same result but they will be longer and sometimes un-necessary....i am still a starter in SSvr but i would still look for the best & neat way to write the code.....it gives satisfaction. I will keep putting questions on VFP-SQL on forum ...(TO ALL) keep helping me ....thanks for patient reading!
Sanjay Dhiraj Patel

MCSE, MCDBA

Net2Biz (Thailand)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform