_BusinessDataAdmin2::Connect Method [C++]

Use this method to connect the object to the profile data store.

Definition

[C++]

HRESULT _BusinessDataAdmin2::Connect(VARIANT*connectString,
  VARIANT*UserName,
  VARIANT*Pwd,
);

[Visual Basic]

Sub Connect(connectString As Variant,
  Optional UserName As Variant,
  Optional Pwd As Variant)

Parameters

  • connectString[C++]
    [in] A pointer to a VARIANT that contains the connection string.
  • connectString[Visual Basic]
    A Variant that contains the connection string.
  • UserName[C++]
    [in, optional] A pointer to a VARIANT that contains the user name. The default value is "". Use this parameter only if the connection string does not contain a user name.
  • UserName[Visual Basic]
    A Variant that contains the user name. The default value is "". Use this parameter only if the connection string does not contain a user name.
  • Pwd[C++]
    [in, optional] A pointer to a VARIANT that contains the password. The default value is "". Use this parameter only if the connection string does not contain a password.
  • Pwd[Visual Basic]
    A Variant that contains the password. The default value is "". Use this parameter only if the connection string does not contain a password.

Return Values

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

[Visual Basic] None.

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) or S_FALSE (&H00000001) to indicate success and to either standard or custom COM error values to indicate failure. If this method returns a property or object it will return Nothing on failure. The method may succeed and yet return Nothing due to a subtle syntax error or a request for a property or object that does not exist. Test the return value for Nothing before relying on it. 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
ERR_MISSING_COREDLL

[C++] 0x800A00B9

[Visual Basic] &H800A00B9

(185)

The Microsoft Commerce Server Core library is missing, not registered, or could not load properly. Please reinstall Commerce Server 4.0.

(File: '%0\\McscCore.dll')

ERR_WRONG_PARAM

[C++] 0x800A0072

[Visual Basic] &H800A0072

114

Error: Wrong input parameter (check for Empty or Null input parameter)
ERR_INVALID_CONNSTR_TOKENS

[C++] 0x800A00CE

[Visual Basic] &H800A00CE

206

Operations cannot be performed against the Master database.

Remarks

This method must be called prior to calling either the ExportCatalogs or ImportCatalogs method.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

[Visual Basic]

Example

' strConnect is a valid connection string 
' that contains the user ID and password.

myBusinessDataAdmin2.Connect strConnect

See Also

[C++]BusinessDataAdmin2 Object

[Visual Basic]BusinessDataAdmin2 Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.