Retrieving enum types as string
Posted: 02.03.2009, 18:24
Hi,
Using Delphi 7, Zeos 6.6.0.
I have a database table in MySQL 5.0.26 (linux) that has the following fields defined :
iselectrical enum('Y','N')
Interest enum('Y','N','U')
When I try and uses FieldByName('iselectrical').AsString it always returns 'true' or 'false', whereas if i use FieldByName('Interest'), it returns one of 'Y','N' or 'U'.
When I look at the type information for the 'iselectrical' field it is set to ftBoolean, whereas the type of 'Interest' is ftString.
Is there anyway of overiding this behavior, though I can understand why this is coded this way.
Cheers.
Phill.
Using Delphi 7, Zeos 6.6.0.
I have a database table in MySQL 5.0.26 (linux) that has the following fields defined :
iselectrical enum('Y','N')
Interest enum('Y','N','U')
When I try and uses FieldByName('iselectrical').AsString it always returns 'true' or 'false', whereas if i use FieldByName('Interest'), it returns one of 'Y','N' or 'U'.
When I look at the type information for the 'iselectrical' field it is set to ftBoolean, whereas the type of 'Interest' is ftString.
Is there anyway of overiding this behavior, though I can understand why this is coded this way.
Cheers.
Phill.