IMSAdminBase::SaveData

The IMSAdminBase::SaveData method explicitly saves the metabase data to disk. The metabase data is saved in the metabase storage file, by default named metabase.bin in the INETSRV directory in which you installed IIS, or to the file specified in the Windows NTŪ registry key LOCAL_MACHINE\\SOFTWARE\\Microsoft\\INetMgr\\Parameters if the file has been relocated as discussed in the Security topic of the IIS Metabase section.

You must not have a handle open with write permission when you call this method, or the method will fail. The process waits for a few seconds for handles to close, so other processes with write handles open should not normally interfere with the save operation.

Syntax

HRESULT SaveData( void );

Return Values

Returns an HRESULT that contains one of the following values:

ERROR_PATH_BUSY The path specified cannot be used at this time.
ERROR_SUCCESS The method succeeded.
File system error codes See winerror.h for information about specific error codes.

Remarks

All data in the metabase is saved, including data written by other applications.

This method will fail and return ERROR_PATH_BUSY if there are any open write handles to the metabase.

Metabase data is saved when IIS shuts down, so you usually do not need to call this method. However, for critical data it is recommended that you call it whenever appropriate for your application.