Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP Builder Utility
Message
From
29/12/2000 18:45:17
 
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00457879
Message ID:
00458001
Views:
21
>An example for an Update would be if it coould not find the PK specified, then no update would take place. In SQL Server not finding any rows that match the criteria of the where clause is not an error so it doesn't generate one. You could have code to check if any records were updated (maybe using the @@Rowcount variable) and if it is equal to 0, then use RAISEERROR to give some feedback to the developer/user. How does your Data Access class check now if the appropriate data change was successful?
>
>Deletions are the same. How do you know something was actually deleted? While @@Rowcount may not be good here (unless you are deleting one item), you could attempt a select on the passed criteria. If anything is returned, then RAISEERROR.
>
>These are just suggestions and they could be implemented outside the SP. You may do that now in your class.

For update procedures, my data access class returns an XML message containing All sproc return values, output parameters, any error codes, and the number of rows affected. My business object class knows how to parse these messages to ensure that an update was successful. If you use ADO to call your sprocs, this stuff is easy...

FWIW, I plan on uploading my Data Access class soon as well, it just needs a little more polishing...
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform