SmsCommitFolder

The SmsCommitFolder function writes any changes to a folder to the site database (that is, changes carried out by calls to SmsLinkFolder and SmsUnlinkFolder).

SMS_STATUS SmsCommitFolder(
  HANDLE hFolder  // Handle to folder to commit.
);
 

Parameters

hFolder
Specifies the folder to commit.

Remarks

SmsCommitFolder is the only function that modifies the SMS site database. SmsLinkFolder and SmsUnlinkFolder only modify folders within the application's memory. (Note that SmsCommitFilter also modifies the site database by adding machine filters to the database as queries.)

When your application creates a folder, it must call SmsCreateFolder to create the folder (within the application's memory), set the scalars for the new folder, call SmsLinkFolder to link the new folder to its parent (within the application's memory), and call SmsCommitFolder to write the folder to the site database.

When your application deletes a folder, it must call SmsUnlinkFolder to unlink the folder from its parent (within the application's memory) and call SmsCommitFolder to delete the folder from the site database.

Note Some types of folders require their parent folder to be committed. These folders are not written to the site database until their parent folders are committed. If a folder requires its parent to be committed, the SmsCommitFolder function returns SMS_PARENT_NEEDS_COMMIT.

Return Values

The SmsCommitFolder function returns a status code SMS_STATUS. If successful, the function returns a status of SMS_OK. Otherwise, it returns one of the following manifest constants:

SMS_COMMIT_FAILED
For SmsCommitFolder, the folder could not be committed to the site database.
SMS_INVALID_HANDLE
The specified folder handle is not a valid folder handle.
SMS_FOLDER_ALREADY_DELETED
An action was attempted on a folder that has already been deleted.
SMS_FOLDER_NOT_MODIFIED
Your application attempted to commit a newly-created folder whose scalars have not been set sufficiently to be added to the site database. Additional scalars may need to be set within the specified folder.
SMS_FOLDER_NO_UPDATE
The folder is of a type that has read-only access.
SMS_PARENT_NEEDS_COMMIT
Your application must also commit the parent folder of the specified folder in order to commit the specified folder to the site database.
SMS_INVALID_PARAMETER
One of the folder's scalars does not contain a valid value.
SMS_CONNECT_FAILED
The connection to the site database has been broken. The folder could not be committed to the database.
SMS_INVALID_FOLDER_ID
Your application has attempted to commit a folder with an invalid identifier.
SMS_ERROR
An unexpected error condition. Usually, this is a SQL Server error.

See Also

SmsCreateFolder, SmsLinkFolder, SmsUnlinkFolder