ISCPersistenceUnitCollection::Remove Arguments

Here is the signature for the Remove function:

VARIANT_BOOL Remove(VARIANT Selector, VARIANT Save)

The following table contains the valid arguments for the Remove function:

Parameter

Valid Type/Value

Description

Selector

VT_UNKNOWN � Pointer to ISCPersistenceUnit interface

Identifies the persistence unit.

Selector

VT_BSTR � ID of a persistence unit

Application-wide unique persistence unit identifier.

Selector

VT_I4 � Index of a persistence unit in the persistence unit collection

Ordered position in the collection. The index is zero-based.

Save [optional]

VT_BOOL

If set to TRUE, it saves the persistence unit prior to removing it from the collection. By default, all unsaved data is saved unless the Save parameter has a FALSE value, or the unit has a temporary status with an unspecified location property.

Models should be closed prior to exiting the application. Add the following line in your code to provide a call to explicitly close the model prior to exiting your application:

...
SaveNewPersistenceUnit(ThePersistenceUnit, DefaultFileName)
TheApplication.PersistenceUnits.Remove(ThePersistenceUnit, False)
...