Welcome, Guest
Username: Password: Remember me
Components and Libraries for Database Development, discussions, problems and suggestions
  • Page:
  • 1

TOPIC:

Adding BlobField into dBase database 13 years 7 months ago #994

  • Gintas
  • Gintas's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Graphics Designer/Developer
  • Posts: 32
  • Thank you received: 3
I have no luck with adding files into TBlobField.
Here is the code:
procedure TMainForm.InsertDbClick(Sender: TObject);
var  fStream:TFileStream;
begin
  with OpenFiles do
  if Execute then begin
  fStream:=TFileStream.Create(FileName,fmOpenRead);
  try
  DBA.FieldDefs.Add('Image',ftBlob,fStream.Size,true);
  TBlobField(DBA.FieldByName('Image')).
          LoadFromFile(FileName);

  finally
    fStream.Free;
  end;
  DBA.Post;
  end;
end;

It throws me error that "Image" field doesn't exist.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1