Custom input format COM objects are used by Log Parser in two different scenarios: when executing a query, and when displaying a quick-reference help on the custom input format when the Log Parser command-line executable is used in Help Mode.
To make an example of the sequence of the method calls invoked by Log Parser on the custom input format COM object in this scenario, we will assume that the custom input format generates input records containing the following four fields:
SELECT FourthField, ThirdField FROM InputFile.txt WHERE FirstField LIKE '%test%'
Method call | Returned value | Returned value description |
---|---|---|
Object is instantiated | ||
OpenInput("InputFile.txt") | None | |
GetFieldCount() | 4 | |
GetFieldName(0) | "FirstField" | |
GetFieldType(0) | 3 | FieldType.String |
GetFieldName(1) | "SecondField" | |
GetFieldType(1) | 1 | FieldType.Integer |
GetFieldName(2) | "ThirdField" | |
GetFieldType(2) | 4 | FieldType.Timestamp |
GetFieldName(3) | "FourthField" | |
GetFieldType(3) | 3 | FieldType.String |
ReadRecord() | TRUE | an input record is available |
GetValue(0) | VT_BSTR VARIANT | first field value |
GetValue(2) | VT_DATE VARIANT | third field value |
GetValue(3) | VT_BSTR VARIANT | fourth field value |
ReadRecord() | TRUE | an input record is available |
GetValue(0) | VT_BSTR VARIANT | first field value |
GetValue(2) | VT_DATE VARIANT | third field value |
GetValue(3) | VT_BSTR VARIANT | fourth field value |
... | ... | ... |
ReadRecord() | TRUE | an input record is available |
GetValue(0) | VT_BSTR VARIANT | first field value |
GetValue(2) | VT_DATE VARIANT | third field value |
GetValue(3) | VT_BSTR VARIANT | fourth field value |
ReadRecord() | FALSE | no more input records available |
CloseInput(FALSE) | None | |
Object is released |
The user-supplied help mode command may or may be not include a from-entity, as shown in the following examples:
C:\>LogParser -h -i:COM -iProgID:MySample.CustomInputFormat file.txt
C:\>LogParser -h -i:COM -iProgID:MySample.CustomInputFormatIf the user-supplied help mode command does not include a from-entity, then the bszFromEntity argument of the OpenInput method will be an empty string. See the Remarks section of the OpenInput Method Reference for more information on how custom input format COM objects should behave in this case.
To make an example of the sequence of the method calls invoked by Log Parser on the custom input format COM object in this scenario, we will assume that the custom input format generates input records containing the following four fields:
Method call | Returned value | Returned value description |
---|---|---|
Object is instantiated | ||
OpenInput("") | None | |
GetFieldCount() | 4 | |
GetFieldName(0) | "FirstField" | |
GetFieldType(0) | 3 | FieldType.String |
GetFieldName(1) | "SecondField" | |
GetFieldType(1) | 1 | FieldType.Integer |
GetFieldName(2) | "ThirdField" | |
GetFieldType(2) | 4 | FieldType.Timestamp |
GetFieldName(3) | "FourthField" | |
GetFieldType(3) | 3 | FieldType.String |
CloseInput(FALSE) | None | |
Object is released |
© 2004 Microsoft Corporation. All rights reserved.