IMSCSDBStorage_3_0::LookupData

Ee784029.c++_off(en-US,CS.10).gifEe784029.vb_on(en-US,CS.10).gif

Use this method to retrieve a single row from the data source based upon column names and values that you specify. If the data is found, this method creates and returns an OrderForm or Dictionary object (depending on the vtProgID parameter passed to the InitStorage method) containing the requested data.

Definition

HRESULT IMSCSDBStorage_3_0::LookupData(VARIANTvtReserved,VARIANT*pvtKeys,VARIANT*pvtValues,VARIANT*pvtRet);

Parameters

vtReserved

[in] A VARIANT reserved for future use. The LookupData method ignores any value stored in this parameter.

pvtKeys

[in] A pointer to a VARIANT that identifies the columns in which to search for the data. This VARIANT can be either a SimpleList object or a SAFEARRAY.

pvtValues

[in] A pointer to a VARIANT that identifies the values for which to search. This parameter can be either a SimpleList object or a SAFEARRAY.

pvtRet

[out, retval] A pointer to a VARIANT used to return the result of the lookup; this VARIANT references an IDispatch interface pointer on a Dictionary object that contains the row data. If the method call is unsuccessful, this parameter evaluates to NULL.

Return Values

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

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. 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

The pvtRet parameter points to valid data only if the method returns successfully.

The pvtKeys and pvtValues parameters are arrays that you pass to the LookupData method share in an index-to-index relationship. This means that they must contain an identical number of members and that the value stored in the pvtValues (N) parameter will be searched for in the column specified by the pvtKeys (N) parameter.

If the arrays contain more than one element, the LookupData method searches for a row in which all of the column/value pairs match.

Because the LookupData method returns only a single row of data, specifying column and value information that would result in the retrieval of more than one row results in an error.

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

See Also

DBStorage Object

IMSCSDBStorage_3_0::InitStorage

IMSCSDBStorage_3_0::GetData

IMSCSDBStorage_3_0::LookupMultipleData


All rights reserved.