Solved

TBlobField SaveToFile

Posted on 2004-08-31
10
4,712 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now