Solved

TBlobField SaveToFile

Posted on 2004-08-31
10
4,755 Views
Last Modified: 2008-01-09
The following open question in Delphi refers: http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21109485.html

I am really desperate at this stage. My problem is that the following code, does not download the files correctly. They are corrupted (so it seems) with retrieval from the database.

Both questions points to accepted answer.

with dm.qBLOB do //tquery
  begin
      Close;
      SQL.Clear;
      SQL.Add('SELECT CPLANT_BLOB FROM DOCBLOB WHERE DOCUMENT = :DOC');
      parambyname('DOC').AsString := curdocid.Text; //editbox
      Open;
      try
      TBlobField(dm.qBLOB.FieldByName('CPLANT_BLOB')).SaveToFile(dirname);
      Close;
      MessageDlg(curdoctitle.Text + ' successfully retrieved from the database.', mtInformation, [mbOK], 0 );
     
  except
  Close;
  MessageDlg(curdoctitle.Text + ' could not be retrieved from the database.', mtError, [mbOK], 0 );
  Exit;
  end;
end;
end;

BDE BLOB setting:

DB.Params.add('BLOB SIZE=9000');

Any help please

Any help please
0
Comment
Question by:barnarp
  • 4
  • 2
10 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11940362
>DB.Params.add('BLOB SIZE=9000');
9000 is a too high value -> max limit is 1000 (1MB),
this entry applys only for dead datasets (non live)

well usual it should work without any corruption,
maybe you need an update of the bde or the sqllinks

what bde-version do you use?
0
 

Author Comment

by:barnarp
ID: 11940726
BDE version 5.01

I changed the code to DB.Params.add('BLOB SIZE=1000');

Still no change. I will now try to change the BLOB field to LONG RAW on the database and see if that makes a difference.
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 11940920
in the BDE, on Drivers page, you was able to choose 2 Dll's. One of the was not working properly, but I don't remember which exactly.

Maybe you can View / Blob Explorer and try to view blob field from there. Maybe it will give you some more reasonable error....
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
barnarp earned 0 total points
ID: 11941595
I changed the field on the Oracle table from BLOB to LONG RAW and now it works.

I don't know why.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 11943736
glad you solved it this way,

but it should also work with a blob-type, just courious

meikl ;-)
0
 

Author Comment

by:barnarp
ID: 11949221
Thanks for all the comments
0
 

Author Comment

by:barnarp
ID: 11949348
Yes thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question