CDataSource::Open

HRESULT Open( const CLSID& clsid, DBPROPSET* pPropSet = NULL );

HRESULT Open( const CLSID& clsid, LPCTSTR pName = NULL, LPCTSTR pUserName = NULL, LPCTSTR pPassword = NULL, long nInitMode = 0 );

HRESULT Open( LPCTSTR szProgID, DBPROPSET* pPropSet );

HRESULT Open( LPCTSTR szProgID, LPCTSTR pName = NULL, LPCTSTR pUserName = NULL, LPCTSTR pPassword = NULL, long nInitMode = 0 );

HRESULT Open( const CEnumerator& enumerator, DBPROPSET* pPropSet = NULL );

HRESULT Open( const CEnumerator& enumerator, LPCTSTR pName = NULL, LPCTSTR pUserName = NULL, LPCTSTR pPassword = NULL, long nInitMode = 0 );

HRESULT Open( HWND hWnd = GetActiveWindow(), DBPROMPTOPTIONS dwPromptOptions = DBPROMPTOPTIONS_WIZARDSHEET );

Return Value

A standard HRESULT.

Parameters

clsid

[in] The CLSID of the data provider.

pPropSet

[in] A pointer to a DBPROPSET structure containing properties and values to be used to initialize the provider. The properties must belong to the Initialization property group. See CDBPropSet for further information.

pName

[in] The name of the database to connect to.

pUserName

[in] The name of the user.

pPassword

[in] The user's password.

nInitMode

[in] Database initialization mode. See Initialization Properties in the OLE DB Programmer's Reference for a list of valid initialization modes. If nInitMode is zero, no initialization mode is included in the property set used to open the connection.

szProgID

[in] A program identifier.

enumerator

[in] A CEnumerator object used to obtain a moniker for opening the connection when the caller does not specify a CLSID.

hWnd

[in] Handle to the window that is to be the parent of the dialog box.

dwPromptOptions

[in] Determines the style of locator dialog box to display. See Msdasc.h for possible values.

Remarks

Opens a connection to a data source using a CLSID, program ID, or moniker or prompts the user with a locator dialog box.

CDataSource OverviewClass Members