| Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Returns the IDataSource interface on an object.
[Visual Basic,VBScript] Public Property DataSource as IDataSource read-only [C++] HRESULT get_DataSource(IDataSource** ppVal); [IDL] HRESULT [propget] DataSource([out,retval] IDataSource** ppVal);
This property returns the IDataSource interface on the object.
With VBScript, you cannot omit certain optional parameters when accessing IDataSource methods, such as SaveTo and Open. When the second argument is a _Connection interface, it must be explicitly set to 'Nothing'. If you get a runtime 'Type Mismatch' error when using IDataSource::SaveTo or IDataSource::Open, then try setting the second argument to 'Nothing'.
The following example shows the use of the IDataSource interface on the ProcessDefinition object to create a new ProcessDefinition item by binding to a new URL, creating the ActionTable, setting some properties on the item, and saving the item.
Dim iPD As New CDOWF.ProcessDefinition
Dim conn As New ADODB.Connection
sDomainURL = "file://./backofficestorage/" _
& Environ("USERDNSDOMAIN") & _
"/Public Folders/"
sFolderURL = sDomainURL & sFolderName
sProcDefURL = sFolderURL & "/" & sProcDef
conn.Provider = "ExOleDb.DataSource"
conn.Open sFolderURL
conn.BeginTrans
With iPD
.ActionTable = Rs
'Rs is open ADODB.Recordset built at runtime
.AuditTrailProvider = "CdoWf.AuditTrailEventLog"
.CommonScriptURL = sCommonScriptURL
.Mode = cdowfPrivilegedMode
.Fields("DAV:ishidden") = True
End With
iPD.DataSource.SaveTo sProcDefURL, _
conn, _
adModeReadWrite, _
adCreateOverwrite Or adCreateNonCollection
conn.CommitTrans