다음을 통해 공유


CDataSource::OpenWithPromptFileName

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CDataSource::OpenWithPromptFileName.

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

Syntax

  
      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/oledb/htm/oledbole_db_services.asp?frame=true.

Requirements

Header: atldbcli.h

See Also

CDataSource Class