ISqlSyncMetadataStore::OpenStore

Opens an existing metadata store file and returns a metadata store object that represents it.

HRESULT OpenStore(
  LPCWSTR pcszFileName,
  ULONG   ulLcid);

Parameters

  • pcszFileName
    [in, string] The file path and file name for the database file. The file path can be a relative path. In this case, it is relative to the current directory.
  • ulLcid
    [in] The locale ID for the database. This must be the same local ID as that used to create the metadata store when ISqlSyncMetadataStore::CreateStore was called.

Return Value

  • S_OK

  • E_POINTER

  • E_INVALIDARG when pcszFileName is empty.

  • SYNC_E_METADATA_INVALID_OPERATION when the metadata store is already open, which occurs when OpenStore is called twice.

  • SYNC_E_METADATA_STORAGE_ENGINE_ERROR when the metadata store cannot be accessed.

Remarks

This method opens an existing metadata store. To create a new metadata store file, use ISqlSyncMetadataStore::CreateStore.

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).

See Also

Reference

ISqlSyncMetadataStore Interface