Solved

TBlobField SaveToFile

Posted on 2004-08-31
10
4,747 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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