Subject Re: [firebird-support] Treat a VARCHAR OCTETS column as binary in Delphi
Author Olivier Mascia
Le 12-févr.-05 à 14:13, fxam a écrit :

> 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.

This is a dbExpress issue because the engine and the client dll have no
issues returning such a binary string, I did it often in the past (last
year). Unless a recent error has been introduced, it should be okay,
but I can't speak for the dbExpress driver.

--
Olivier Mascia