18.104.22.168.3 ExecuteAccountingQuery (Opnum 9)
The ExecuteAccountingQuery method executes an accounting query.
[id(3), helpstring("method ExecuteAccountingQuery")] HRESULT ExecuteAccountingQuery( [in] BSTR bstrAccountingQuery, [in] BSTR bstrStartingDate, [in] BSTR bstrEndingDate, [out] BSTR* pbstrResult, [out] BOOL* pbIsThereMoreData );
bstrAccountingQuery: A string that specifies an AccountingQueryCondition element (section 22.214.171.124) in XML. For an example, see section 4.2.5.
bstrStartingDate: A string that specifies the starting date for the query, in date-and-time format (section 126.96.36.199). If this value is not in the correct format, the date range is ignored and the complete set of accounting data is returned.
bstrEndingDate: A string that specifies the ending date for the query, in date-and-time format. If this value is not in the correct format, the date range is ignored and the complete set of accounting data is returned.
pbstrResult: A pointer to a string that returns the requested data.
This string is formatted as a set of rows representing accounting process entries. Rows are delimited by carriage return escape characters (\r). Each row is a set of columns delimited by newline escape characters (\n). The columns correspond in number and order to the columns specified in the AccountingQueryCondition element in the bstrAccountingQuery parameter.
pbIsThereMoreData: A pointer to a Boolean value that specifies whether more data is available.
One or more arguments are invalid.
Cannot establish a connection to the accounting database.<41>
The query has been canceled. One or more of the column names specified in the accounting query are invalid.
One or more SQL SELECT columns cannot be selected because of the current SQL GROUP BY settings. These columns MUST be grouped to be selected.
One or more columns specified for SQL GROUP BY is either invalid or cannot be grouped on.
The server can service only one accounting request at a time.<42>
The query has been aborted since the management service is being shut down.
The error WRM_ERR_JET_PIVOTABLE_COLUMN_NOT_GROUPED_BY is returned in cases where a column with the IsVisible attribute set to FALSE is included in the SQL SELECT column while there are some columns in the group column collection. The following sample AccountingQueryCondition XML (section 188.8.131.52) SHOULD return this error:
<AccountingQueryCondition> <SelectFieldCollection> <Column>ProcessName</Column> <Column>ProcessId</Column> </SelectFieldCollection> <GroupColumnCollection> <Column>ProcessName</Column> </GroupColumnCollection> <OrderColumnCollection /> <HavingClause /> </AccountingQueryCondition>
Additional IWRMAccounting interface methods are specified in section 184.108.40.206.