Subject Re: [IBO] Varchar with #0 char in it
Author Ed Dressel
> I'm not sure if it is pertinent, but are you referring to the field
> using .Value or .AsString? The .Value method does save extra code in
> loops but the downside is it accesses the values as variants and
> relies on Delphi to do the casting. That does increase the risk of
> undesired effects such as (possibly) the encounter with the ascii-
> zero causing the string to be interpreted as null-terminated. I
> always use the casting methods where possible...

here is my code:

procedure TdmDatabase.SetEncryptedFieldText(Sender: TField; const
Text: String);
var
lID: Integer;
begin
if Sender.DataSet.FieldByName('Encrypted').AsBoolean then
begin
lID := ...
if not (Sender.Dataset.State in dsEditModes) then
Sender.Dataset.Edit;

Sender.AsString := GeneralFunctions.GetEncryptedData(Text, lID, ...);
end;
end;

any other ideas?

Ed Dressel