Subject Treat a VARCHAR OCTETS column as binary in Delphi
Author fxam
I have a field which is VARCHAR(500) with OCTETS as charset. My data has
null character (ascii 0) in it. For example, in hex, 40 D8 00 DC. If this
field is treated as string, I will not get that DC.

I am using Firebird Embedded 1.5.2.

Using Interbase dbExpress driver to connect to fbembed.dll, this field is
always created as a TStringField at runtime

I tried various ways and still can't get the data after the null character:
-Field[0].AsString does not work
-Field[0].GetData(buf, true) does not work
-creating the following TField explicitly will result in error:
TVarBytesField, TBytesField, TArrayField and TBlobField. The runtime error
is "Type mismatch for field 'Column1', expecting: <Field Type> actual:
String' where <Field Type> is VarBytes, Bytes, Array or Blob.

Is there a way to make this field loaded as a binary stream, and not a
string? I don't want to make this field a blob :)