[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to delete (remove picture) blob from a Firebird 2.0 blobfield using clientdataset.

Posted on 2009-04-07
4
Medium Priority
?
1,072 Views
Last Modified: 2012-05-06
I'd like to know how to remove picture from a blob field.

I tried to create an empty memory stream and copy that to clientdatasets blob field.

That removed picture cds but after applyupdates the picture got back (never went away).

Pekka
procedure TEtusivu.IWButton1Click(Sender: TObject);
var
   strBlob, strTmp: TStream;
begin
  try
   cdsBlobtest.Edit;
   strBlob := cdsBlobtest.CreateBlobStream(cdsBlobtest.FieldByName('Image'), bmWrite);
   strTmp := TMemoryStream.Create;
   strBlob.CopyFrom(strTmp,0);
   cdsBlobtest.Post;
   cdsBlobtest.ApplyUpdates(0);
  finally
    strBlob.Free;
    strTmpfree; 
  end;
 
end;

Open in new window

0
Comment
Question by:ppaunio
[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 Comments
 
LVL 1

Accepted Solution

by:
chunky1 earned 375 total points
ID: 24085943
Hi,
I have never tried this but how about editing the record and assigning Null to the field something like:

cdsBlobtest.Edit
cdsblobtest.fieldvalues['Image']:=null;
cdsblobset.post;

Might be worht a try.

Paul.
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 24086113
or use a sql statement in a query

UPDATE TABLE SET FIELD = NULL WHERE ID = 1
0
 
LVL 18

Expert Comment

by:Johnjces
ID: 24087627
Try also..

cdsBlobtest.FieldByName('Image').asVariant := '';

Have edit above and post below of course. This does work for me.

John
0
 

Author Closing Comment

by:ppaunio
ID: 31567441
Yes this worked. Have to remember to put 'Variants' in the uses section.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

656 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