Platform SDK: Exchange 2000 Server

SaveToContainer Method

[This is preliminary documentation and subject to change.]

Binds to and saves data into a new item in the folder/container specified by URL. The item name is a generated globally unique identifier (GUID).

[Visual Basic,VBScript]
Sub SaveToContainer(
  ByVal ContainerURL as String,
  ByVal ActiveConnection as Object,
  [ByVal Mode as ConnectModeEnum],
  [ByVal CreateOptions as RecordCreateOptionsEnum],
  [ByVal Options as RecordOpenOptionsEnum],
  [ByVal UserName as String],
  [ByVal Password as String]
)
[C++]
HRESULT SaveToContainer(
  BSTR ContainerURL,
  IDispatch* ActiveConnection = 0,
  ConnectModeEnum Mode,
  RecordCreateOptionsEnum CreateOptions,
  RecordOpenOptionsEnum Options,
  BSTR UserName,
  BSTR Password
);
[IDL]
HRESULT SaveToContainer(
  [in]           BSTR ContainerURL, 
  [in, defaultvalue(0)] IDispatch* ActiveConnection, 
  [in, optional] ConnectModeEnum Mode, 
  [in, optional] RecordCreateOptionsEnum CreateOptions, 
  [in, optional] RecordOpenOptionsEnum Options, 
  [in, optional] BSTR UserName, 
  [in, optional] BSTR Password
);
ContainerURL
The URL of the folder/collection resource into which the item is to be saved.
ActiveConnection
Specifies the optional connection to use when saving. This is an IDispatch interface to an ADO Connection object. A new Connection (session) object is implicitly created if none is specified.
Mode
Access mode. This value is always ORed with adModeReadWrite. That is, at least read-write access is required to save the item to the container/folder.
CreateOptions
Set of flags to specify creation options. The values adFailIfNotExists and adOpenIfExists should not be used. If used, an E_INVALIDARG exception is raised.
Options
This specifies options flag(s) used when opening the source. Your setting is always ORed with adOpenSource.
UserName
Used to pass a user name for authentication.
Password
Used to pass a password for authentication.

Remarks

The specified URL must identify a valid URL namespace that the OLE DB 2.5 root binder can resolve to a registered provider binder. Once resolved, the URL must conform to that provider binder's URL semantics.

The enumerated values and their semantic definitions are defined as part of the ADO type library and documentation. Consult the ActiveX Data Objects (ADO) Version 2.5 documentation for a list of valid enumeration values and their intended purpose. Use of various enumerated values and their intended meaning is specific to a particular OLE DB 2.5 provider.

Restrictions on what types of data can be saved into a particular resource and how that data is handled by an implementation of the IDataSource interface is not part of this definition. Consult the appropriate COM class reference for further information.

The SaveToContainer method differs from SaveTo in that the name for the resource is automatically generated for you in the container (collection) specified by URL. The name generated by this method is not defined here and is implementation specific.

After successful completion of this method, you can retrieve the full URL to the new object to which you are currently bound by examining the IDataSource.SourceURL property.

Example

[Visual Basic]
No code available
[C++,IDL]
No code available
[VBScript]
No code available