ISqlSyncMetadataStore::CreateStore

Creates a metadata store file and a metadata store object to represent it.

HRESULT CreateStore(
  LPCWSTR pcszFileName,
  ULONG   ulLcid);

Parameters

Parameter Description

pcszFileName

[in, string] The file path and file name for the database file. The file path must exist before this method is called. The file path can be a relative path. In this case, it is relative to the current directory.

ulLcid

[in] The locale ID to use to create the database.

Return Value

  • S_OK

  • E_POINTER

  • E_INVALIDARG when pcszFileName is empty.

  • SYNC_E_METADATA_INVALID_OPERATION when the location specified by pcszFileName is not available, such as when it is already in use.

  • SYNC_E_METADATA_STORAGE_ENGINE_ERROR when the metadata store cannot be created or accessed.

Remarks

If the file does not exist at the location specified by pcszFileName, it will be created.

Security noteSecurity Note

The metadata file is not secured against unauthorized access. To help protect the metadata file, the folder that contains it must be properly secured, such as by using a Discretionary Access Control List (DACL). To allow the user to delete the metadata file, the provider that creates the metadata file should put it somewhere the user can access. The provider that creates the metadata file must delete the metadata file when the provider is uninstalled.

Security noteSecurity Note

When Sync Framework opens the metadata file by a remote mechanism, such as a UNC path, the metadata file cannot be simultaneously accessed by any other application on any computer, including an application on the machine where the metadata file is stored.

See Also

Reference

ISqlSyncMetadataStore Interface