IListManager::Initialize
Use this method to initialize the ListManager object.
Definition
HRESULT IListManager::Initialize(BSTRbstrConnStr,);
Parameters
bstrConnStr
[in] A BSTR that contains the connection string for the database to which the List Manager will connect.
Return Values
This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
The following table shows the custom COM errors that this method can return.
Constant | Value | Description |
E_LM_ALREADYINITIALIZED | 0x8C400002 | The ListManager object has already been initialized and may not be re-initialized. |
E_LM_CONNECTIONFAILED | 0x8C400001 | Failed to establish database connection. |
E_LM_SQLERROR | 0x8C400003 | Error while executing SQL/ADO operation. |
Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
Remarks
Initialize the ListManager object before calling any other ListManager object method or property.
Initializing connects the ListManager object to a database. If the database does not contain the tables and procedures required by the ListManager object, they are created.
A ListManager object can be connected to only one database. To connect to a different database, instantiate a new ListManager object.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.