Compartilhar via


IDataInitialize

Use the IDataInitialize interface to create a data source object using a connection string. You can also retrieve a connection string from an existing data source object.

To build a connection string, use the prompting user interface available through the IDBPromptInitialize interface and then use IDataInitialize to get a data source object based on that connection string.

For more information, see Creating Data Source Objects.

When to Call

Call IDataInitialize to provide a common entry point for consumers to obtain a data source object or to get persistent data source information.

IDataInitialize Methods

Method

Description

IDataInitialize::CreateDBInstance

Creates a data source object. Analogous to CoCreateInstance.

IDataInitialize::CreateDBInstanceEx

Creates a data source object. Analogous to CoCreateInstanceEx.

IDataInitialize::GetDataSource

Given a connection string, instantiates and returns a data source object.

IDataInitialize::GetInitializationString

Given a data source object, returns a connection string.

IDataInitialize::LoadStringFromStorage

Loads a connection string from storage.

IDataInitialize::WriteStringToStorage

Writes a connection string to storage.