Web Connection
wwBusiness :: Delete() Return Value
Gravatar is a globally recognized avatar based on your email address. wwBusiness :: Delete() Return Value
  Harvey Mushman
  All
  Dec 31, 2016 @ 08:39am

Assuming the documentation is correct...

wwBusiness Delete()

I would assume if the delete fails the return value will be false as described above.

However, if oWwBusiness.nDataMode = 0 the result is always returned .t. (true).

The screen shot below shows the code that is used...

What if any suggestions could be made to determine the actual status of the DELETE command. VFP does not return a value from the DELETE FOR that I'm aware which suggests one would need to know the record number before the DELETE and then test for the record deleted() status after the DELETE command was execuited. Seems like a lot of work...

Gravatar is a globally recognized avatar based on your email address. re: wwBusiness :: Delete() Return Value
  Harvey Mushman
  Harvey Mushman
  Dec 31, 2016 @ 09:55am

In thinking a bit more about this and the limitations of VFP, mabe the most correct solution would be something along the following:

 
 DELETE FROM (this.cAlias) WHERE &lcPKField == lnPk
 IF _TALLY = 0
  RETURN .F.
 ENDIF
 

Any other thoughts?

Gravatar is a globally recognized avatar based on your email address. re: wwBusiness :: Delete() Return Value
  Rick Strahl
  Harvey Mushman
  Dec 31, 2016 @ 08:37pm

As we discussed earlier this is by design.

A Delete operation that doesnt' find a match is still considered a success because the deleted item is gone after all. Only hard failures will trigger a .f. response.

+++ Rick ---

© 1996-2024