IListManager::Initialize Method [C++]

Use this method to initialize the ListManager object.

Definition

[C++]

HRESULT IListManager::Initialize(BSTRbstrConnStr,
);

[Visual Basic]

Sub Initialize(bstrConnStr As String,
)

Parameters

  • bstrConnStr[C++]
    [in] A BSTR that contains the connection string for the database to which the List Manager will connect.
  • bstrConnStr[Visual Basic]
    A String that contains the connection string for the database to which the List Manager will connect.

[C++]

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

[C++] 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.

[Visual Basic] This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM 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 [C++] 0x8C400002

[Visual Basic] &H8C400002

The ListManager object has already been initialized and may not be re-initialized.
E_LM_CONNECTIONFAILED [C++] 0x8C400001

[Visual Basic] &H8C400001

Failed to establish database connection.
E_LM_SQLERROR [C++] 0x8C400003

[Visual Basic] &H8C400003

Error while executing SQL/ADO operation.

[C++] 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.

[Visual Basic] Additional information may be available using the global Err object. In particular, the Description property may contain 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.

[Visual Basic]

Example

oListManager.Initialize "Provider=sqloledb;" & _
 "Data Source=TequillaServer;Initial Catalog=Margaritas;" & _
 "Integrated Security='SSPI'"

See Also

[C++]ListManager Object

[C++]IListManager::ExportToSQL

[Visual Basic]ListManager Object

[Visual Basic]ListManager.ExportToSQL

Copyright © 2005 Microsoft Corporation.
All rights reserved.