Freigeben über


CDataSource::OpenWithPromptFileName

This method prompts the user with a dialog box, then opens a data source using the file specified by the user.

HRESULT OpenWithPromptFileName( 
   HWND hWnd = GetActiveWindow( 
   ), 
   DBPROMPTOPTIONS dwPromptOptions = DBPROMPTOPTIONS_NONE, 
   LPCOLESTR szInitialDirectory = NULL  
) throw( );

Parameters

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

  • szInitialDirectory
    [in] The initial directory to display in the locator dialog box.

Return Value

A standard HRESULT.

Remarks

This method opens a data source object using the service components in oledb32.dll; this DLL contains the implementation of Service Components features such as Resource Pooling, Automatic Transaction Enlistment, and so on. For more information, see "OLE DB Services" in the OLE DB Programmer's Reference at https://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledbole_db_services.asp?frame=true.

Requirements

Header: atldbcli.h

See Also

Reference

CDataSource Class

Other Resources

CDataSource Members