Solved

TBlobField SaveToFile

Posted on 2004-08-31
10
4,777 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

690 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