|
virtual bool Open(LPCOLESTR strConnection, bool bUseCCE=true, bool
bPooling=true, short nPrompt=DBPROMPT_COMPLETEREQUIRED); Return Value true if a CODataSource object is opened and its connection is initialized successfully; otherwise false. Parameters [in] strConnection: A connection string. [in] clsidProvider: A CLSID of an OLEDB provider. [in] hWnd: The parent window handle for Data Link dialog boxes to be displayed. The dialog box will always be centered within this window. [in] bUseCCE: Indicates if MS client cursor engine service is enabled. [in] bPooling: Indicates if resource pooling service is enabled. [in] nPrompt: Specifies whether to prompt a user during initialization. [in] nPromptOptions: Specifies whether to prompt with the Create New Data Link wizard or the Data Link Properties dialog box. Remarks The three functions always use MS data link object to build a connection to an OLEDB provider. The first version of functions calls the second version of functions. The last version function prompt a data link wizard or properties dialog to a user for setting initialization properties. You can use these functions to enable or disable various data access services such as client cursor engine, resource pooling and others easily. For how to use the three functions, see provided examples. In few cases, you may need to use other ways to build a connection to an OLEDB data source object, which you can refer to ATL consumer templates and Microsoft support web site. |