Share via


DataSource Property

DataSource Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns the IDataSource Interface on an object. This property is read-only.

Applies To

IProcessDefinition Interface

Type Library

Microsoft CDO Workflow Objects for Microsoft Exchange

DLL Implemented In

CDOWF.DLL

Syntax

[Visual Basic]Property DataSource As IDataSource

[C++]HRESULT get_DataSource(IDataSource** pVal);

Parameters

Remarks

This property returns the IDataSource Interface on the object.

With Microsoft Visual Basic Scripting Edition (VBScript), you cannot omit certain optional parameters when accessing IDataSource Interface methods, such as the SaveTo Method and Open Method. When the second argument is a _Connection interface, it must be explicitly set to 'Nothing'. If you get a run-time 'Type Mismatch' error when using SaveTo Method or Open Method, try setting the second argument to 'Nothing'.

Example

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.

[Visual Basic]

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 an open ADODB.Recordset built at run time

.AuditTrailProvider = "CdoWf.AuditTrailEventLog"
.CommonScriptURL = sCommonScriptURL
.Mode = cdowfPrivilegedMode
.Fields("DAV:ishidden") = True

End With

iPD.DataSource.SaveTo sProcDefURL, _ conn, _ adModeReadWrite, _ adCreateOverwrite Or adCreateNonCollection

conn.CommitTrans

' Close connection. conn.Close Set conn = Nothing

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.