Deletes an object's database record. If the collection's IDatabaseObjects.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: DatabaseObjectsAssembly: DatabaseObjects (in DatabaseObjects.dll) Version: 3.8.1.0
Syntax
C# |
---|
public void ObjectDelete( IDatabaseObjects objCollection, ref IDatabaseObject objItem ) |
Visual Basic |
---|
Public Sub ObjectDelete ( _ objCollection As IDatabaseObjects, _ ByRef objItem As IDatabaseObject _ ) |
Visual C++ |
---|
public: void ObjectDelete( IDatabaseObjects^ objCollection, IDatabaseObject^% objItem ) |
Parameters
- objCollection
- Type: DatabaseObjects..::..IDatabaseObjects
The collection that contains the object to delete. If the item does not exist within the collection then the object will not be deleted.
- 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. Reference Type: IDatabaseObject (DatabaseObjects.IDatabaseObject)
Examples
CopyC#
Public Sub Delete(ByRef objProduct As Product) objDatabase.ObjectDelete(Me, objProduct) 'objProduct will now be Nothing End Sub