Board index » delphi » 'invalid blob length'

'invalid blob length'

The following is a program to save an accessory to oracle8 database.
the oracle table field's data type is [long raw];
when the accessory 's size is beyond 20K,the error is 'invalid blob length'.
But when the accessory's size is lower 10k,there is no error.
And when I change BDE to ADO,there is no error too.
I don't know why,how I can achieve it using BDE?

{the code is following}
procedure TfrmAccessory.btnSaveClick(Sender: TObject);
var
  MS: TMemoryStream;
begin
  MS:=TMemoryStream.create;
  ms.LoadFromFile(edtFileName.Text);
  MS.Position:=0;
  Tattach.Open ;
  Tattach.Append;
  TBlobField(TAttach.FieldbyName('Content')).LoadFromStream(MS);
  TAttach.Post;
  ms.Free ;
end;

 

Re:'invalid blob length'


On BDE Administrator set the property BLOB SIZE above 20 ( for example, set
to 256) and BLOBS TO CACHE to -1.

Fred.

"delphi News" <yan...@yeah.net> escreveu na mensagem
news:3c54aa78_1@dnews...

Quote
> The following is a program to save an accessory to oracle8 database.
> the oracle table field's data type is [long raw];
> when the accessory 's size is beyond 20K,the error is 'invalid blob
length'.
> But when the accessory's size is lower 10k,there is no error.
> And when I change BDE to ADO,there is no error too.
> I don't know why,how I can achieve it using BDE?

> {the code is following}
> procedure TfrmAccessory.btnSaveClick(Sender: TObject);
> var
>   MS: TMemoryStream;
> begin
>   MS:=TMemoryStream.create;
>   ms.LoadFromFile(edtFileName.Text);
>   MS.Position:=0;
>   Tattach.Open ;
>   Tattach.Append;
>   TBlobField(TAttach.FieldbyName('Content')).LoadFromStream(MS);
>   TAttach.Post;
>   ms.Free ;
> end;

Other Threads