Partilhar via


_BusinessDataAdmin2::Connect Method

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

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

HRESULT _BusinessDataAdmin2::Connect(
  VARIANT* connectString,
  VARIANT* UserName,
  VARIANT* Pwd,
);
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.

\[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.

\[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.

\[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

0x800A00B9

&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

0x800A0072

&H800A0072

114

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

ERR_INVALID_CONNSTR_TOKENS

0x800A00CE

&H800A00CE

206

Operations cannot be performed against the Master database.

Remarks

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

Example

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

myBusinessDataAdmin2.Connect strConnect

See Also

Other Resources

BusinessDataAdmin2 Object