CDataSource Class

 

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

Corresponds to an OLE DB data source object, which represents a connection through a provider to a data source.

class CDataSource  

Methods

CloseCloses the connection.
GetInitializationStringRetrieves the initialization string of the data source that is currently open.
GetPropertiesGets the values of properties currently set for the connected data source.
GetPropertyGets the value of a single property currently set for the connected data source.
OpenCreates a connection to a provider (data source) using either a CLSID, ProgID, or a CEnumerator moniker provided by the caller.
OpenFromFileNameOpens a data source from a file specified by the user-supplied file name.
OpenFromInitializationStringOpens the data source specified by an initialization string.
OpenWithPromptFileNameAllows the user to select a previously created data link file to open the corresponding data source.
OpenWithServiceComponentsOpens a data source object using the Data Link dialog box.

One or more database sessions can be created for a single connection. These sessions are represented by CSession. You must call CDataSource::Open to open the connection before creating a session with CSession::Open.

For an example of how to use CDataSource, see the CatDB sample.

Header: atldbcli.h

OLE DB Consumer Templates
OLE DB Consumer Templates Reference

Show: