Deletes an object's database record. If this collection's Subset has been implemented then the object must exist within the subset, otherwise the object will not be deleted. If the object has not been saved to the database the function will exit without executing an SQL DELETE command. After deleting the database record the object is set to Nothing. The calling function should receive the object ByRef for this to have any affect. Setting the object to Nothing minimises the possibility of the deleted object being used in code after ObjectDelete has been called.

Namespace: DatabaseObjects
Assembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0

Syntax

C#
protected void ObjectDelete(
	ref IDatabaseObject objItem
)
Visual Basic
Protected Sub ObjectDelete ( _
	ByRef objItem As IDatabaseObject _
)
Visual C++
protected:
void ObjectDelete(
	IDatabaseObject^% objItem
)

Parameters

objItem
Type: DatabaseObjects..::..IDatabaseObject%
The object to delete. The calling function should receive this object ByRef as the object is set to Nothing after deletion.

Examples

CopyC#
Public Sub Delete(ByRef objProduct As Product)

    MyBase.ObjectDelete(objProduct)

End Sub

See Also