[VCOM] Question: How to get the Field-Type?
blackfin
blackfin at elfenherz.de
Sun Oct 21 09:23:53 CDT 2007
Ruslan Zasukhin schrieb:
> On 21/10/07 5:12 PM, "blackfin" <blackfin at elfenherz.de> wrote:
>
> Hi Martin,
>
>> How to determine the Field-Type in VCOM?
>>
>> Example:
>>
>> Cursor := DB.sqlselect('SELECT * FROM T1') ;
>> Cursor.Firstrecord() ;
>>
>> Then, when I do a...
>>
>> FieldType := Cursor.Field(index).type_ ;
>>
>> ...I get an access violation.
>>
>> I tried Fieldtype for every numeric type (as Integer, TOleNum, Cardinal
>> etc ...), but none works, always an access violation.
>
> Try split it on 2 lines:
>
> fld := Cursor.Field(index)
>
> FieldType := fld.type_ ;
>
> And see if fld is not nil before you call .type
>
>
Ok, tried. Does not work either.
It is NOT nil but a Vfield, I also successfully fill a Grid View with
the field.name(s) and field.value(s), but when accessing field.type_, I
get this access violation.
>
>
More information about the Valentina
mailing list