FieldByName('fieldname').AsString not Returning entire field
Posted: Tue 28 Oct 2008 20:21
I have a field in an SQL DB that is defined as CHAR(100)...I am using the SDAC components (still on trial)...and I am performing the following:
TempStr := datamodule.tablename.fieldbyname('fieldname').asstring;
As I said this field is defined as CHAR(100)...however, its only returning data up to the first NULL it finds in the field...not the entire 100 bytes. How do I get this to function to return all 100 bytes of the field and not stop at the first NULL value in the field that it runs into?
I know...this is not good database management...however, this DB came from an old COBOL system where they did a lot of large fields with several sub-fields in them so they didn't have to keep expanding the DB.
In COBOL this is pretty easy to diffine in a buffer...but I'm struggling with accessing all 100 bytes of data in Delphi 6.
Any recomomendation?
Thanks,
Jim
TempStr := datamodule.tablename.fieldbyname('fieldname').asstring;
As I said this field is defined as CHAR(100)...however, its only returning data up to the first NULL it finds in the field...not the entire 100 bytes. How do I get this to function to return all 100 bytes of the field and not stop at the first NULL value in the field that it runs into?
I know...this is not good database management...however, this DB came from an old COBOL system where they did a lot of large fields with several sub-fields in them so they didn't have to keep expanding the DB.
In COBOL this is pretty easy to diffine in a buffer...but I'm struggling with accessing all 100 bytes of data in Delphi 6.
Any recomomendation?
Thanks,
Jim