How can i get Delphi 7 to return a ‘0’ or ‘1’ when the FieldType of a TQuery descendant’s Field is a ftBoolean? By default this returns ‘TRUE’ or ‘FALSE’, that is
Query1.Fields[0].AsString would return '0', not 'FALSE'
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Unfortunately it appears that the only way to do this is to check for every TField:
if
(Query1.Fields[i] is TBooleanField)and then use one of the methods provided above.There is no global
TField.AsStringhack as far as I’m aware.