How to save and access image field

D7.

I have a table in Access:
Employee:
EmpID Integer AutoNumber,
EmpName Text(50),
Picture (OLE/Object)

On the main form I have a text box and TImage.
After I entered the name of the employee and load the jpeg to the TImage, I 
want to save into the table.

What should I do to assign the parameter in the query of this picture:

qryAddNewEmployee:
INSERT INTO Emp (EmpName, Picture)
VALUES (:EmpName, :EmpPicture)

with qryAddNewEmployee do
try
  Close;
  Parameters.ParamByName('EmpName').Value := edtName.Text;
  Parameters.ParamByName('EmpPicture').Value := <-- what should be here
  ExecSQL;
except
end;

And also if I want to fetch the records from the table, how to load into the 
TImage?
qryFetchEmployee:
SELECT *
FROM Emp
WHERE EmpID = 34

with qryFetchEmployee do
try
  Close;
  Open;
  edtName.Text :=  FieldByName('EmpName').AsString;
                         :=  FieldByName('EmpPicture').   <-- what should be 
here

except
end;
1
Pak
9/28/2008 6:19:21 AM
embarcadero.delphi.ado 597 articles. 1 followers. Follow

16 Replies
2118 Views

Similar Articles

[PageSpeed] 18

"Pak Tse" <alan_nospam_pltse@yahoo.com.au> wrote in message 
news:22071@forums.codegear.com...
> D7.
>
> I have a table in Access:
> Employee:
> EmpID Integer AutoNumber,
> EmpName Text(50),
> Picture (OLE/Object)
>
> On the main form I have a text box and TImage.
> After I entered the name of the employee and load the jpeg to the TImage, 
> I want to save into the table.

Take a look here..
http://delphi.about.com/od/blob/BLOBs_in_Delphi_DB_programming.htm
http://delphi.about.com/od/database/l/aa030601a.htm

Good luck,
krf
0
Kevin
9/28/2008 12:07:47 PM
>> D7.
>>
>> I have a table in Access:
>> Employee:
>> EmpID Integer AutoNumber,
>> EmpName Text(50),
>> Picture (OLE/Object)
>>
>> On the main form I have a text box and TImage.
>> After I entered the name of the employee and load the jpeg to the TImage, 
>> I want to save into the table.
>
> Take a look here..
> http://delphi.about.com/od/blob/BLOBs_in_Delphi_DB_programming.htm
> http://delphi.about.com/od/database/l/aa030601a.htm

Hi,
Thanks for your links.
I managed to get the picture from the OLE Object field from the table and 
converts to a JPEG and display on the TImage control.

However, I am still searching for how do I convert a TJpegImage to a 'value' 
so that can assign to the parameter to save back to database:

This is my object:

TEmployee = class
private
  fEmpID: Integer;
  fName: String;
  fPicture: TJpegImage;
public
  property EmpID: Integer read fEmpID write fEmpID;
  property EmpName: String read fEmpName write fEmpName;
  property Picture: TJpegImage read fPicture write fPicture;
end;

As stated in my original post:

with qryAddNewEmployee do
try
  Close;
  Parameters.ParamByName('EmpName').Value := fEmp.EmpName;
  Parameters.ParamByName('EmpPicture').Value :=  <-- what should be here 
(how to convert the TJpegImage to a value)
  ExecSQL;
except
end;
0
Pak
10/5/2008 8:40:56 AM
Instead of trying to set the value using an insert or Update query
Open a TadoDataset to your Access table
Then use the code in the SaveJpegToTable from the URL you where referenced to.
Alternatly you can try using the Tparameter.loadfromStream method similar to how it is used in SaveJpegtoTable method




> {quote:title=Pak Tse wrote:}{quote}
> D7.
> 
> I have a table in Access:
> Employee:
> EmpID Integer AutoNumber,
> EmpName Text(50),
> Picture (OLE/Object)
> 
> On the main form I have a text box and TImage.
> After I entered the name of the employee and load the jpeg to the TImage, I 
> want to save into the table.
> 
> What should I do to assign the parameter in the query of this picture:
> 
> qryAddNewEmployee:
> INSERT INTO Emp (EmpName, Picture)
> VALUES (:EmpName, :EmpPicture)
> 
> with qryAddNewEmployee do
> try
>   Close;
>   Parameters.ParamByName('EmpName').Value := edtName.Text;
>   Parameters.ParamByName('EmpPicture').Value := <-- what should be here
>   ExecSQL;
> except
> end;
> 
> And also if I want to fetch the records from the table, how to load into the 
> TImage?
> qryFetchEmployee:
> SELECT *
> FROM Emp
> WHERE EmpID = 34
> 
> with qryFetchEmployee do
> try
>   Close;
>   Open;
>   edtName.Text :=  FieldByName('EmpName').AsString;
>                          :=  FieldByName('EmpPicture').   <-- what should be 
> here
> 
> except
> end;
0
Brian
10/5/2008 11:44:47 PM
<Brian Bushay> wrote in message news:25686@forums.codegear.com...
> Instead of trying to set the value using an insert or Update query
> Open a TadoDataset to your Access table
> Then use the code in the SaveJpegToTable from the URL you where referenced 
> to.
> Alternatly you can try using the Tparameter.loadfromStream method similar 
> to how it is used in SaveJpegtoTable method

>> D7.
>>
>> I have a table in Access:
>> Employee:
>> EmpID Integer AutoNumber,
>> EmpName Text(50),
>> Picture (OLE/Object)
>>
>> On the main form I have a text box and TImage.
>> After I entered the name of the employee and load the jpeg to the TImage, 
>> I
>> want to save into the table.
>>
>> What should I do to assign the parameter in the query of this picture:
>>
>> qryAddNewEmployee:
>> INSERT INTO Emp (EmpName, Picture)
>> VALUES (:EmpName, :EmpPicture)
>>
>> with qryAddNewEmployee do
>> try
>>   Close;
>>   Parameters.ParamByName('EmpName').Value := edtName.Text;
>>   Parameters.ParamByName('EmpPicture').Value := <-- what should be here
>>   ExecSQL;
>> except
>> end;

Hi,

I am now using the TADODataSet to store the image by

function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
var
  iLastID, iNewID: Integer;
  blobF : TBlobField;
  bs : TStream;
begin
  Result := FALSE;
with dataSetEmpDetails do
  try
    Open;
    Append;
    FieldByName('Name').AsString := aEmpObj.Name;
    FieldByName('Description').AsString := aEmpObj.Desc;
    blobF := FieldByName('Picture') as TBlobField;
    bs := CreateBlobStream(blobF, bmWrite) ;
    try
      bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
    finally
      bs.Free;
    end;
    Post;
    Result := TRUE;
  finally
    Close;
  end;
end;

It seems can save to the MS Access table, but I noticed the value in the MS 
Access table field 'Picture' is
'Long Binary Data'.
Is this normal? The actual picture type in my Emp object is TJpegImage.
I have 'manually' added 2 records inside MS Access(open MS Access and link 
to the JPeg image) and the Picture field is 'Package' type.

In addition, when I tried to retrieve this image back to the Employee 
object, I got the Strem read error.

These are the methods I used:

function JpegStartsInBlob(aPicField:TBlobField): Integer;
var
 bS     : TADOBlobStream;
 buffer : Word;
 hx     : string;
begin
  Result := -1;
  bS := TADOBlobStream.Create(aPicField, bmRead);
  try
    while (Result = -1) and (bS.Position + 1 < bS.Size) do
    begin
      bS.ReadBuffer(buffer, 1);
      hx:=IntToHex(buffer, 2);
      if hx = 'FF' then
      begin
        bS.ReadBuffer(buffer, 1);
        hx:=IntToHex(buffer, 2);
        if hx = 'D8' then
          Result := bS.Position - 2
        else if hx = 'FF' then
           bS.Position := bS.Position-1;
      end; //if
    end; //while
  finally
    bS.Free
  end;  //try
end;

function GetJpegPicture(aPicField: TBlobField): TJpegImage;
var
  bS: TADOBlobStream;
begin
  bS := TADOBlobStream.Create(aPicField, bmRead);
  try
    bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
    Result := TJpegImage.Create;
    try
      Result.LoadFromStream(bS);
    finally
      bS.Free;
    end;
  finally
  end;
end;
0
Pak
10/12/2008 6:34:06 AM
Long Binary Data is correct for what you are storing


> {quote:title=Pak Tse wrote:}{quote}
> <Brian Bushay> wrote in message news:25686@forums.codegear.com...
> > Instead of trying to set the value using an insert or Update query
> > Open a TadoDataset to your Access table
> > Then use the code in the SaveJpegToTable from the URL you where referenced 
> > to.
> > Alternatly you can try using the Tparameter.loadfromStream method similar 
> > to how it is used in SaveJpegtoTable method
> 
> >> D7.
> >>
> >> I have a table in Access:
> >> Employee:
> >> EmpID Integer AutoNumber,
> >> EmpName Text(50),
> >> Picture (OLE/Object)
> >>
> >> On the main form I have a text box and TImage.
> >> After I entered the name of the employee and load the jpeg to the TImage, 
> >> I
> >> want to save into the table.
> >>
> >> What should I do to assign the parameter in the query of this picture:
> >>
> >> qryAddNewEmployee:
> >> INSERT INTO Emp (EmpName, Picture)
> >> VALUES (:EmpName, :EmpPicture)
> >>
> >> with qryAddNewEmployee do
> >> try
> >>   Close;
> >>   Parameters.ParamByName('EmpName').Value := edtName.Text;
> >>   Parameters.ParamByName('EmpPicture').Value := <-- what should be here
> >>   ExecSQL;
> >> except
> >> end;
> 
> Hi,
> 
> I am now using the TADODataSet to store the image by
> 
> function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
> var
>   iLastID, iNewID: Integer;
>   blobF : TBlobField;
>   bs : TStream;
> begin
>   Result := FALSE;
> with dataSetEmpDetails do
>   try
>     Open;
>     Append;
>     FieldByName('Name').AsString := aEmpObj.Name;
>     FieldByName('Description').AsString := aEmpObj.Desc;
>     blobF := FieldByName('Picture') as TBlobField;
>     bs := CreateBlobStream(blobF, bmWrite) ;
>     try
>       bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
>     finally
>       bs.Free;
>     end;
>     Post;
>     Result := TRUE;
>   finally
>     Close;
>   end;
> end;
> 
> It seems can save to the MS Access table, but I noticed the value in the MS 
> Access table field 'Picture' is
> 'Long Binary Data'.
> Is this normal? The actual picture type in my Emp object is TJpegImage.
> I have 'manually' added 2 records inside MS Access(open MS Access and link 
> to the JPeg image) and the Picture field is 'Package' type.
> 
> In addition, when I tried to retrieve this image back to the Employee 
> object, I got the Strem read error.
> 
> These are the methods I used:
> 
> function JpegStartsInBlob(aPicField:TBlobField): Integer;
> var
>  bS     : TADOBlobStream;
>  buffer : Word;
>  hx     : string;
> begin
>   Result := -1;
>   bS := TADOBlobStream.Create(aPicField, bmRead);
>   try
>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
>     begin
>       bS.ReadBuffer(buffer, 1);
>       hx:=IntToHex(buffer, 2);
>       if hx = 'FF' then
>       begin
>         bS.ReadBuffer(buffer, 1);
>         hx:=IntToHex(buffer, 2);
>         if hx = 'D8' then
>           Result := bS.Position - 2
>         else if hx = 'FF' then
>            bS.Position := bS.Position-1;
>       end; //if
>     end; //while
>   finally
>     bS.Free
>   end;  //try
> end;
> 
> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
> var
>   bS: TADOBlobStream;
> begin
>   bS := TADOBlobStream.Create(aPicField, bmRead);
>   try
>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>     Result := TJpegImage.Create;
>     try
>       Result.LoadFromStream(bS);
>     finally
>       bS.Free;
>     end;
>   finally
>   end;
> end;
0
Brian
10/13/2008 1:44:22 AM
Hi,

In the records that I 'manually' created inside MS Access (by opening MS 
Access and enter data and link the jpeg picture to the fields, these becomes 
the 'Package' as shown inside the data view inside MS Access), I can 
retrieve the image to my custom object and display on the form using an 
image control by using the methods I just posted.

However, when I  tried to use these same method to retrieve that 'Long 
Binary Data', I got that stream error. Any idea?

<Brian Bushay> wrote in message news:28430@forums.codegear.com...
> Long Binary Data is correct for what you are storing
>
>
>> {quote:title=Pak Tse wrote:}{quote}
>> <Brian Bushay> wrote in message news:25686@forums.codegear.com...
>> > Instead of trying to set the value using an insert or Update query
>> > Open a TadoDataset to your Access table
>> > Then use the code in the SaveJpegToTable from the URL you where 
>> > referenced
>> > to.
>> > Alternatly you can try using the Tparameter.loadfromStream method 
>> > similar
>> > to how it is used in SaveJpegtoTable method
>>
>> >> D7.
>> >>
>> >> I have a table in Access:
>> >> Employee:
>> >> EmpID Integer AutoNumber,
>> >> EmpName Text(50),
>> >> Picture (OLE/Object)
>> >>
>> >> On the main form I have a text box and TImage.
>> >> After I entered the name of the employee and load the jpeg to the 
>> >> TImage,
>> >> I
>> >> want to save into the table.
>> >>
>> >> What should I do to assign the parameter in the query of this picture:
>> >>
>> >> qryAddNewEmployee:
>> >> INSERT INTO Emp (EmpName, Picture)
>> >> VALUES (:EmpName, :EmpPicture)
>> >>
>> >> with qryAddNewEmployee do
>> >> try
>> >>   Close;
>> >>   Parameters.ParamByName('EmpName').Value := edtName.Text;
>> >>   Parameters.ParamByName('EmpPicture').Value := <-- what should be 
>> >> here
>> >>   ExecSQL;
>> >> except
>> >> end;
>>
>> Hi,
>>
>> I am now using the TADODataSet to store the image by
>>
>> function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
>> var
>>   iLastID, iNewID: Integer;
>>   blobF : TBlobField;
>>   bs : TStream;
>> begin
>>   Result := FALSE;
>> with dataSetEmpDetails do
>>   try
>>     Open;
>>     Append;
>>     FieldByName('Name').AsString := aEmpObj.Name;
>>     FieldByName('Description').AsString := aEmpObj.Desc;
>>     blobF := FieldByName('Picture') as TBlobField;
>>     bs := CreateBlobStream(blobF, bmWrite) ;
>>     try
>>       bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
>>     finally
>>       bs.Free;
>>     end;
>>     Post;
>>     Result := TRUE;
>>   finally
>>     Close;
>>   end;
>> end;
>>
>> It seems can save to the MS Access table, but I noticed the value in the 
>> MS
>> Access table field 'Picture' is
>> 'Long Binary Data'.
>> Is this normal? The actual picture type in my Emp object is TJpegImage.
>> I have 'manually' added 2 records inside MS Access(open MS Access and 
>> link
>> to the JPeg image) and the Picture field is 'Package' type.
>>
>> In addition, when I tried to retrieve this image back to the Employee
>> object, I got the Strem read error.
>>
>> These are the methods I used:
>>
>> function JpegStartsInBlob(aPicField:TBlobField): Integer;
>> var
>>  bS     : TADOBlobStream;
>>  buffer : Word;
>>  hx     : string;
>> begin
>>   Result := -1;
>>   bS := TADOBlobStream.Create(aPicField, bmRead);
>>   try
>>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
>>     begin
>>       bS.ReadBuffer(buffer, 1);
>>       hx:=IntToHex(buffer, 2);
>>       if hx = 'FF' then
>>       begin
>>         bS.ReadBuffer(buffer, 1);
>>         hx:=IntToHex(buffer, 2);
>>         if hx = 'D8' then
>>           Result := bS.Position - 2
>>         else if hx = 'FF' then
>>            bS.Position := bS.Position-1;
>>       end; //if
>>     end; //while
>>   finally
>>     bS.Free
>>   end;  //try
>> end;
>>
>> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
>> var
>>   bS: TADOBlobStream;
>> begin
>>   bS := TADOBlobStream.Create(aPicField, bmRead);
>>   try
>>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>>     Result := TJpegImage.Create;
>>     try
>>       Result.LoadFromStream(bS);
>>     finally
>>       bS.Free;
>>     end;
>>   finally
>>   end;
>> end;
0
Pak
10/13/2008 5:26:11 AM
You seem to be pulling the data for the Jpeg out using the JpegStartsInBlob method that allows you to read a jpeg written by access but your code to store a jpeg does not put that data into the stored value so that when you retrive it you only retervieve the later portion of the jpeg


> {quote:title=Pak Tse wrote:}{quote}
> Hi,
> 
> In the records that I 'manually' created inside MS Access (by opening MS 
> Access and enter data and link the jpeg picture to the fields, these becomes 
> the 'Package' as shown inside the data view inside MS Access), I can 
> retrieve the image to my custom object and display on the form using an 
> image control by using the methods I just posted.
> 
> However, when I  tried to use these same method to retrieve that 'Long 
> Binary Data', I got that stream error. Any idea?
> 
> <Brian Bushay> wrote in message news:28430@forums.codegear.com...
> > Long Binary Data is correct for what you are storing
> >
> >
> >> {quote:title=Pak Tse wrote:}{quote}
> >> <Brian Bushay> wrote in message news:25686@forums.codegear.com...
> >> > Instead of trying to set the value using an insert or Update query
> >> > Open a TadoDataset to your Access table
> >> > Then use the code in the SaveJpegToTable from the URL you where 
> >> > referenced
> >> > to.
> >> > Alternatly you can try using the Tparameter.loadfromStream method 
> >> > similar
> >> > to how it is used in SaveJpegtoTable method
> >>
> >> >> D7.
> >> >>
> >> >> I have a table in Access:
> >> >> Employee:
> >> >> EmpID Integer AutoNumber,
> >> >> EmpName Text(50),
> >> >> Picture (OLE/Object)
> >> >>
> >> >> On the main form I have a text box and TImage.
> >> >> After I entered the name of the employee and load the jpeg to the 
> >> >> TImage,
> >> >> I
> >> >> want to save into the table.
> >> >>
> >> >> What should I do to assign the parameter in the query of this picture:
> >> >>
> >> >> qryAddNewEmployee:
> >> >> INSERT INTO Emp (EmpName, Picture)
> >> >> VALUES (:EmpName, :EmpPicture)
> >> >>
> >> >> with qryAddNewEmployee do
> >> >> try
> >> >>   Close;
> >> >>   Parameters.ParamByName('EmpName').Value := edtName.Text;
> >> >>   Parameters.ParamByName('EmpPicture').Value := <-- what should be 
> >> >> here
> >> >>   ExecSQL;
> >> >> except
> >> >> end;
> >>
> >> Hi,
> >>
> >> I am now using the TADODataSet to store the image by
> >>
> >> function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
> >> var
> >>   iLastID, iNewID: Integer;
> >>   blobF : TBlobField;
> >>   bs : TStream;
> >> begin
> >>   Result := FALSE;
> >> with dataSetEmpDetails do
> >>   try
> >>     Open;
> >>     Append;
> >>     FieldByName('Name').AsString := aEmpObj.Name;
> >>     FieldByName('Description').AsString := aEmpObj.Desc;
> >>     blobF := FieldByName('Picture') as TBlobField;
> >>     bs := CreateBlobStream(blobF, bmWrite) ;
> >>     try
> >>       bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
> >>     finally
> >>       bs.Free;
> >>     end;
> >>     Post;
> >>     Result := TRUE;
> >>   finally
> >>     Close;
> >>   end;
> >> end;
> >>
> >> It seems can save to the MS Access table, but I noticed the value in the 
> >> MS
> >> Access table field 'Picture' is
> >> 'Long Binary Data'.
> >> Is this normal? The actual picture type in my Emp object is TJpegImage.
> >> I have 'manually' added 2 records inside MS Access(open MS Access and 
> >> link
> >> to the JPeg image) and the Picture field is 'Package' type.
> >>
> >> In addition, when I tried to retrieve this image back to the Employee
> >> object, I got the Strem read error.
> >>
> >> These are the methods I used:
> >>
> >> function JpegStartsInBlob(aPicField:TBlobField): Integer;
> >> var
> >>  bS     : TADOBlobStream;
> >>  buffer : Word;
> >>  hx     : string;
> >> begin
> >>   Result := -1;
> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >>   try
> >>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
> >>     begin
> >>       bS.ReadBuffer(buffer, 1);
> >>       hx:=IntToHex(buffer, 2);
> >>       if hx = 'FF' then
> >>       begin
> >>         bS.ReadBuffer(buffer, 1);
> >>         hx:=IntToHex(buffer, 2);
> >>         if hx = 'D8' then
> >>           Result := bS.Position - 2
> >>         else if hx = 'FF' then
> >>            bS.Position := bS.Position-1;
> >>       end; //if
> >>     end; //while
> >>   finally
> >>     bS.Free
> >>   end;  //try
> >> end;
> >>
> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
> >> var
> >>   bS: TADOBlobStream;
> >> begin
> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >>   try
> >>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> >>     Result := TJpegImage.Create;
> >>     try
> >>       Result.LoadFromStream(bS);
> >>     finally
> >>       bS.Free;
> >>     end;
> >>   finally
> >>   end;
> >> end;
0
Brian
10/14/2008 1:45:38 AM
<Brian Bushay> wrote in message news:28922@forums.codegear.com...
> You seem to be pulling the data for the Jpeg out using the 
> JpegStartsInBlob method that allows you to read a jpeg written by access 
> but your code to store a jpeg does not put that data into the stored value 
> so that when you retrive it you only retervieve the later portion of the 
> jpeg

>> >> I am now using the TADODataSet to store the image by
>> >>
>> >> function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
>> >> var
>> >>   iLastID, iNewID: Integer;
>> >>   blobF : TBlobField;
>> >>   bs : TStream;
>> >> begin
>> >>   Result := FALSE;
>> >> with dataSetEmpDetails do
>> >>   try
>> >>     Open;
>> >>     Append;
>> >>     FieldByName('Name').AsString := aEmpObj.Name;
>> >>     FieldByName('Description').AsString := aEmpObj.Desc;
>> >>     blobF := FieldByName('Picture') as TBlobField;
>> >>     bs := CreateBlobStream(blobF, bmWrite) ;
>> >>     try
>> >>       bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
>> >>     finally
>> >>       bs.Free;
>> >>     end;
>> >>     Post;
>> >>     Result := TRUE;
>> >>   finally
>> >>     Close;
>> >>   end;
>> >> end;
>> >>
>> >> It seems can save to the MS Access table, but I noticed the value in 
>> >> the
>> >> MS
>> >> Access table field 'Picture' is
>> >> 'Long Binary Data'.
>> >> Is this normal? The actual picture type in my Emp object is 
>> >> TJpegImage.
>> >> I have 'manually' added 2 records inside MS Access(open MS Access and
>> >> link
>> >> to the JPeg image) and the Picture field is 'Package' type.
>> >>
>> >> In addition, when I tried to retrieve this image back to the Employee
>> >> object, I got the Strem read error.
>> >>
>> >> These are the methods I used:
>> >>
>> >> function JpegStartsInBlob(aPicField:TBlobField): Integer;
>> >> var
>> >>  bS     : TADOBlobStream;
>> >>  buffer : Word;
>> >>  hx     : string;
>> >> begin
>> >>   Result := -1;
>> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
>> >>   try
>> >>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
>> >>     begin
>> >>       bS.ReadBuffer(buffer, 1);
>> >>       hx:=IntToHex(buffer, 2);
>> >>       if hx = 'FF' then
>> >>       begin
>> >>         bS.ReadBuffer(buffer, 1);
>> >>         hx:=IntToHex(buffer, 2);
>> >>         if hx = 'D8' then
>> >>           Result := bS.Position - 2
>> >>         else if hx = 'FF' then
>> >>            bS.Position := bS.Position-1;
>> >>       end; //if
>> >>     end; //while
>> >>   finally
>> >>     bS.Free
>> >>   end;  //try
>> >> end;
>> >>
>> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
>> >> var
>> >>   bS: TADOBlobStream;
>> >> begin
>> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
>> >>   try
>> >>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>> >>     Result := TJpegImage.Create;
>> >>     try
>> >>       Result.LoadFromStream(bS);
>> >>     finally
>> >>       bS.Free;
>> >>     end;
>> >>   finally
>> >>   end;
>> >> end;

Sorry,
Are you saying the way that I saved to the Access table is NOT the whole 
image data?
Is this where the problem is:

with adoDataset do
begin
  Open;
  Append;
  blobF := FieldByName('Picture') as TBlobField;
  bs := CreateBlobStream(blobF, bmWrite) ;
  try
     bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
  finally
    bs.Free;
  end;
  Post;
end;
0
Pak
10/14/2008 4:08:27 AM
> {quote:title=Pak Tse wrote:}{quote}
> <Brian Bushay> wrote in message news:28922@forums.codegear.com...
> > You seem to be pulling the data for the Jpeg out using the 
> > JpegStartsInBlob method that allows you to read a jpeg written by access 
> > but your code to store a jpeg does not put that data into the stored value 
> > so that when you retrive it you only retervieve the later portion of the 
> > jpeg
> 
> >> >> I am now using the TADODataSet to store the image by
> >> >>
> >> >> function TEmpAccessDataModule.AddNewEmp(aEmpObj: TEmpObj): Boolean;
> >> >> var
> >> >>   iLastID, iNewID: Integer;
> >> >>   blobF : TBlobField;
> >> >>   bs : TStream;
> >> >> begin
> >> >>   Result := FALSE;
> >> >> with dataSetEmpDetails do
> >> >>   try
> >> >>     Open;
> >> >>     Append;
> >> >>     FieldByName('Name').AsString := aEmpObj.Name;
> >> >>     FieldByName('Description').AsString := aEmpObj.Desc;
> >> >>     blobF := FieldByName('Picture') as TBlobField;
> >> >>     bs := CreateBlobStream(blobF, bmWrite) ;
> >> >>     try
> >> >>       bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
> >> >>     finally
> >> >>       bs.Free;
> >> >>     end;
> >> >>     Post;
> >> >>     Result := TRUE;
> >> >>   finally
> >> >>     Close;
> >> >>   end;
> >> >> end;
> >> >>
> >> >> It seems can save to the MS Access table, but I noticed the value in 
> >> >> the
> >> >> MS
> >> >> Access table field 'Picture' is
> >> >> 'Long Binary Data'.
> >> >> Is this normal? The actual picture type in my Emp object is 
> >> >> TJpegImage.
> >> >> I have 'manually' added 2 records inside MS Access(open MS Access and
> >> >> link
> >> >> to the JPeg image) and the Picture field is 'Package' type.
> >> >>
> >> >> In addition, when I tried to retrieve this image back to the Employee
> >> >> object, I got the Strem read error.
> >> >>
> >> >> These are the methods I used:
> >> >>
> >> >> function JpegStartsInBlob(aPicField:TBlobField): Integer;
> >> >> var
> >> >>  bS     : TADOBlobStream;
> >> >>  buffer : Word;
> >> >>  hx     : string;
> >> >> begin
> >> >>   Result := -1;
> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >> >>   try
> >> >>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
> >> >>     begin
> >> >>       bS.ReadBuffer(buffer, 1);
> >> >>       hx:=IntToHex(buffer, 2);
> >> >>       if hx = 'FF' then
> >> >>       begin
> >> >>         bS.ReadBuffer(buffer, 1);
> >> >>         hx:=IntToHex(buffer, 2);
> >> >>         if hx = 'D8' then
> >> >>           Result := bS.Position - 2
> >> >>         else if hx = 'FF' then
> >> >>            bS.Position := bS.Position-1;
> >> >>       end; //if
> >> >>     end; //while
> >> >>   finally
> >> >>     bS.Free
> >> >>   end;  //try
> >> >> end;
> >> >>
> >> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
> >> >> var
> >> >>   bS: TADOBlobStream;
> >> >> begin
> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >> >>   try
> >> >>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> >> >>     Result := TJpegImage.Create;
> >> >>     try
> >> >>       Result.LoadFromStream(bS);
> >> >>     finally
> >> >>       bS.Free;
> >> >>     end;
> >> >>   finally
> >> >>   end;
> >> >> end;
> 
> Sorry,
> Are you saying the way that I saved to the Access table is NOT the whole 
> image data?
> Is this where the problem is:
> 
> with adoDataset do
> begin
>   Open;
>   Append;
>   blobF := FieldByName('Picture') as TBlobField;
>   bs := CreateBlobStream(blobF, bmWrite) ;
>   try
>      bs.Write(aEmpObj.Picture, SizeOf(aEmpObj.Picture));
>   finally
>     bs.Free;
>   end;
>   Post;
> end;

No.  When you save a Jpeg within Access it adds some header data to the file.
So the JpegStartsInBlob method allows delphi to ignore this header and just retrieve the Jpeg.
When you are saving a Jped with Delphi you are not putting the header value into the blob.
So when you use the JpegStartsInBlob to retrive a jpeg that does not have a header you only retrieve part of the Jpeg
0
Brian
10/15/2008 2:27:21 AM
<Brian Bushay> wrote in message news:29528@forums.codegear.com...
>> {quote:title=Pak Tse wrote:}{quote}
>> <Brian Bushay> wrote in message news:28922@forums.codegear.com...
>> > You seem to be pulling the data for the Jpeg out using the
>> > JpegStartsInBlob method that allows you to read a jpeg written by 
>> > access
>> > but your code to store a jpeg does not put that data into the stored 
>> > value
>> > so that when you retrive it you only retervieve the later portion of 
>> > the
>> > jpeg
>>
>> >> >>
>> >> >> These are the methods I used:
>> >> >>
>> >> >> function JpegStartsInBlob(aPicField:TBlobField): Integer;
>> >> >> var
>> >> >>  bS     : TADOBlobStream;
>> >> >>  buffer : Word;
>> >> >>  hx     : string;
>> >> >> begin
>> >> >>   Result := -1;
>> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
>> >> >>   try
>> >> >>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
>> >> >>     begin
>> >> >>       bS.ReadBuffer(buffer, 1);
>> >> >>       hx:=IntToHex(buffer, 2);
>> >> >>       if hx = 'FF' then
>> >> >>       begin
>> >> >>         bS.ReadBuffer(buffer, 1);
>> >> >>         hx:=IntToHex(buffer, 2);
>> >> >>         if hx = 'D8' then
>> >> >>           Result := bS.Position - 2
>> >> >>         else if hx = 'FF' then
>> >> >>            bS.Position := bS.Position-1;
>> >> >>       end; //if
>> >> >>     end; //while
>> >> >>   finally
>> >> >>     bS.Free
>> >> >>   end;  //try
>> >> >> end;
>> >> >>
>> >> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
>> >> >> var
>> >> >>   bS: TADOBlobStream;
>> >> >> begin
>> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
>> >> >>   try
>> >> >>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>> >> >>     Result := TJpegImage.Create;
>> >> >>     try
>> >> >>       Result.LoadFromStream(bS);
>> >> >>     finally
>> >> >>       bS.Free;
>> >> >>     end;
>> >> >>   finally
>> >> >>   end;
>> >> >> end;
>>
> end;
>
> No.  When you save a Jpeg within Access it adds some header data to the 
> file.
> So the JpegStartsInBlob method allows delphi to ignore this header and 
> just retrieve the Jpeg.
> When you are saving a Jped with Delphi you are not putting the header 
> value into the blob.
> So when you use the JpegStartsInBlob to retrive a jpeg that does not have 
> a header you only retrieve part of the Jpeg

It looks like I need to modify:
function GetJpegPicture(aPicField: TBlobField): TJpegImage;
 var
   bS: TADOBlobStream;
begin
  bS := TADOBlobStream.Create(aPicField, bmRead);
  try
   bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
    Result := TJpegImage.Create;
    try
      Result.LoadFromStream(bS);
     finally
      bS.Free;
     end;
   finally
   end;
end;

Change from
bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
to
bS.Seek(0, soFromBeginning);
?
0
Pak
10/15/2008 10:50:49 AM
That will allow you to retrive jpegs stored by your Delphi code but not jpegs you store in Access

> {quote:title=Pak Tse wrote:}{quote}
> <Brian Bushay> wrote in message news:29528@forums.codegear.com...
> >> {quote:title=Pak Tse wrote:}{quote}
> >> <Brian Bushay> wrote in message news:28922@forums.codegear.com...
> >> > You seem to be pulling the data for the Jpeg out using the
> >> > JpegStartsInBlob method that allows you to read a jpeg written by 
> >> > access
> >> > but your code to store a jpeg does not put that data into the stored 
> >> > value
> >> > so that when you retrive it you only retervieve the later portion of 
> >> > the
> >> > jpeg
> >>
> >> >> >>
> >> >> >> These are the methods I used:
> >> >> >>
> >> >> >> function JpegStartsInBlob(aPicField:TBlobField): Integer;
> >> >> >> var
> >> >> >>  bS     : TADOBlobStream;
> >> >> >>  buffer : Word;
> >> >> >>  hx     : string;
> >> >> >> begin
> >> >> >>   Result := -1;
> >> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >> >> >>   try
> >> >> >>     while (Result = -1) and (bS.Position + 1 < bS.Size) do
> >> >> >>     begin
> >> >> >>       bS.ReadBuffer(buffer, 1);
> >> >> >>       hx:=IntToHex(buffer, 2);
> >> >> >>       if hx = 'FF' then
> >> >> >>       begin
> >> >> >>         bS.ReadBuffer(buffer, 1);
> >> >> >>         hx:=IntToHex(buffer, 2);
> >> >> >>         if hx = 'D8' then
> >> >> >>           Result := bS.Position - 2
> >> >> >>         else if hx = 'FF' then
> >> >> >>            bS.Position := bS.Position-1;
> >> >> >>       end; //if
> >> >> >>     end; //while
> >> >> >>   finally
> >> >> >>     bS.Free
> >> >> >>   end;  //try
> >> >> >> end;
> >> >> >>
> >> >> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
> >> >> >> var
> >> >> >>   bS: TADOBlobStream;
> >> >> >> begin
> >> >> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >> >> >>   try
> >> >> >>     bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> >> >> >>     Result := TJpegImage.Create;
> >> >> >>     try
> >> >> >>       Result.LoadFromStream(bS);
> >> >> >>     finally
> >> >> >>       bS.Free;
> >> >> >>     end;
> >> >> >>   finally
> >> >> >>   end;
> >> >> >> end;
> >>
> > end;
> >
> > No.  When you save a Jpeg within Access it adds some header data to the 
> > file.
> > So the JpegStartsInBlob method allows delphi to ignore this header and 
> > just retrieve the Jpeg.
> > When you are saving a Jped with Delphi you are not putting the header 
> > value into the blob.
> > So when you use the JpegStartsInBlob to retrive a jpeg that does not have 
> > a header you only retrieve part of the Jpeg
> 
> It looks like I need to modify:
> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
>  var
>    bS: TADOBlobStream;
> begin
>   bS := TADOBlobStream.Create(aPicField, bmRead);
>   try
>    bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>     Result := TJpegImage.Create;
>     try
>       Result.LoadFromStream(bS);
>      finally
>       bS.Free;
>      end;
>    finally
>    end;
> end;
> 
> Change from
> bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> to
> bS.Seek(0, soFromBeginning);
> ?
0
Brian
10/17/2008 12:11:25 AM
> That will allow you to retrive jpegs stored by your Delphi code but not 
> jpegs you store in Access
>

>> It looks like I need to modify:
>> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
>>  var
>>    bS: TADOBlobStream;
>> begin
>>   bS := TADOBlobStream.Create(aPicField, bmRead);
>>   try
>>    bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>>     Result := TJpegImage.Create;
>>     try
>>       Result.LoadFromStream(bS);
>>      finally
>>       bS.Free;
>>      end;
>>    finally
>>    end;
>> end;
>>
>> Change from
>> bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
>> to
>> bS.Seek(0, soFromBeginning);
>> ?

What do you mean by:
> That will allow you to retrive jpegs stored by your Delphi code but not 
> jpegs you store in Access

If
bS.Seek(0, soFromBeginning);
can retrieve the jpegs stored by my Delphi code then that's what I want.

I will clear my Access table and only save new picture from Delphi.
0
Pak
10/18/2008 7:16:25 AM
> {quote:title=Pak Tse wrote:}{quote}
> > That will allow you to retrive jpegs stored by your Delphi code but not 
> > jpegs you store in Access
> >
> 
> >> It looks like I need to modify:
> >> function GetJpegPicture(aPicField: TBlobField): TJpegImage;
> >>  var
> >>    bS: TADOBlobStream;
> >> begin
> >>   bS := TADOBlobStream.Create(aPicField, bmRead);
> >>   try
> >>    bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> >>     Result := TJpegImage.Create;
> >>     try
> >>       Result.LoadFromStream(bS);
> >>      finally
> >>       bS.Free;
> >>      end;
> >>    finally
> >>    end;
> >> end;
> >>
> >> Change from
> >> bS.Seek(JpegStartsInBlob(aPicField), soFromBeginning);
> >> to
> >> bS.Seek(0, soFromBeginning);
> >> ?
> 
> What do you mean by:

When Access (the program not the database file structure) retrieves a stored graphic it requires header information in the file.  When Access saves a graphic it adds that header information.  If you store a graphic in an Access table from delphi and do not include the header information that graphic will not be retrivealbe with Access



> > That will allow you to retrive jpegs stored by your Delphi code but not 
> > jpegs you store in Access
> 
> If
> bS.Seek(0, soFromBeginning);
> can retrieve the jpegs stored by my Delphi code then that's what I want.
> 
> I will clear my Access table and only save new picture from Delphi.
0
Brian
10/19/2008 10:38:42 PM
<Brian Bushay> wrote in message news:31516@forums.codegear.com...
>> {quote:title=Pak Tse wrote:}{quote}
>> > That will allow you to retrive jpegs stored by your Delphi code but not
>> > jpegs you store in Access
>> >
>>
>> What do you mean by:
>
> When Access (the program not the database file structure) retrieves a 
> stored graphic it requires header information in the file.  When Access 
> saves a graphic it adds that header information.  If you store a graphic 
> in an Access table from delphi and do not include the header information 
> that graphic will not be retrivealbe with Access


What do you suggest how do I store the header as well as the image body when 
I save from Delphi code?
0
Pak
10/20/2008 2:53:05 AM
You have the JpegStartsInBlob method to determin the start of the Jpeg
You can also use it to determin the end of the header then read that section out of an existing blob with a properly formated header

> {quote:title=Pak Tse wrote:}{quote}
> <Brian Bushay> wrote in message news:31516@forums.codegear.com...
> >> {quote:title=Pak Tse wrote:}{quote}
> >> > That will allow you to retrive jpegs stored by your Delphi code but not
> >> > jpegs you store in Access
> >> >
> >>
> >> What do you mean by:
> >
> > When Access (the program not the database file structure) retrieves a 
> > stored graphic it requires header information in the file.  When Access 
> > saves a graphic it adds that header information.  If you store a graphic 
> > in an Access table from delphi and do not include the header information 
> > that graphic will not be retrivealbe with Access
> 
> 
> What do you suggest how do I store the header as well as the image body when 
> I save from Delphi code?
0
Brian
10/21/2008 2:52:37 AM
> You have the JpegStartsInBlob method to determin the start of the Jpeg
> You can also use it to determin the end of the header then read that 
> section out of an existing blob with a properly formated header
>
>> {quote:title=Pak Tse wrote:}{quote}
>> <Brian Bushay> wrote in message news:31516@forums.codegear.com...
>> >> {quote:title=Pak Tse wrote:}{quote}
>> >> > That will allow you to retrive jpegs stored by your Delphi code but 
>> >> > not
>> >> > jpegs you store in Access
>> >> >
>> >>
>> >> What do you mean by:
>> >
>> > When Access (the program not the database file structure) retrieves a
>> > stored graphic it requires header information in the file.  When Access
>> > saves a graphic it adds that header information.  If you store a 
>> > graphic
>> > in an Access table from delphi and do not include the header 
>> > information
>> > that graphic will not be retrivealbe with Access
>>
>>
>> What do you suggest how do I store the header as well as the image body 
>> when
>> I save from Delphi code?

Sorry,
I think I am not sure what you mean.

What I think at the moment will be deletel the Access table, and run my 
application to save image to the Access table.
Then I guess there will be no 'header' information in the image field.

So what do you suggest do I still use the same JpegStartsInBlob  method to 
retrieve the image from the BLOB field?
0
Pak
10/23/2008 2:52:49 AM
Reply:

Similar Artilces:

How to save a picture in a SQL image field and how to show a picture from a SQL image field
HI! I am searching now a real long time in the forum and I found a lot of stuff to this topic. But please help me it doesn't work! On my webapplication there is a possibility to save a private picture.If a new user is saved in the database I want to save a fixed picture as startpicture.Dim picturePath As String = Request.ServerVariables("APPL_PHYSICAL_PATH") & "img\anonymous.jpg" Please tell me the way how to save this anonymous.jpg from the picturePath into the database and after that how to display the picture. Thank you! .         ...

DBD::ADO and Access IMAGE (OLE Object) fields...
Hello all, I'm trying to insert images into an Access database (they're small, and that's how the app was built, not my choice), but I'm running into errors. I'm using... Windows XP SP1 ActiveState Perl: This is perl, v5.8.3 built for MSWin32-x86-multi-thread DBI 1.43 DBD::ADO 2.91 Win32::OLE 0.1701 CGI 3.01 CGI::Carp 1.27 Text::CSV_XS 0.23 I'd appreciate any feedback, and would love to have a solution... Here's a complete stand-alone script that *should* work, but doesn't, quite... Oh, you'll need to find the graphics located at the ...

Hotkey Save Image or Save Image As..
Name: soulmisfit Email: dmokimarinoatgmaildotcom Product: Firefox Summary: Hotkey Save Image or Save Image As.. Comments: Is there a way to assign Hotkeys for Firefox Save Image and Save Image As..? If not that would be a great addition. I searched the trouble shooting data base and didn't find anything related. Browser Details: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one...

ADO.net problem: i can not view image data for the rest of my table rows except the image for the first row but i can read all the other non image fields for all rows.
Hi i have a table with the following fields imgid............int imgdata........image imgtitle.........varchar(max) imgType........varchar(max) imgLength.....bigint incident_id.....int i have no problem with uploading the image but viewing the uploaded image(s) in a gridview has caused me great pain. The probelm is i have two pages. page1 grabs the image to display and page2 has a gridview that displays the grabed image. I wanted to have an sql statement like SELECT * FROM mytable WHERE incident_id=someValue. IF i have 5 records in this table and i view page2 ...

Images from Access Field.
Hello Everybody. If anyone can help... I have an image that i turn to bytes like this:- String fullFileName = Server.MapPath(findImgPath); System.Drawing.Image image = System.Drawing.Image.FromFile(fullFileName); System.IO.MemoryStream bytes = new System.IO.MemoryStream(); if (findImgPath.EndsWith("jpeg")) { image.Save( bytes, System.Drawing.Imaging.ImageFormat.Jpeg ); } else { image.Save( bytes, System.Drawing.Imaging.ImageFormat.Gif); } bytes.Flush(); string imageString = Convert.ToBase64String(bytes.ToArray()); This imageS...

Detect if image has been saved using Image.Save()?
 I wrote a upload program that as soon as user uploads a picture, the next page will show what picture the user has uploaded. However, right now it looks like that the next page will not show any pictures because the file is still being uploaded. In another words, the page has change even before it finishes uploading. Is there a way to detect if Image.Save() has completed or not? thanks in advance. Are u uploading the file asynchronously? paste your code here.  Haissam Abdul MalakMCAD.NET| Blog | using  System.IO.File.Exists(filepath) to detect whether the image ha...

Save image in a blob field
Hi, I've a problem that should be quite simple, I think. But I'm going crazy so I hope that you can help me. I've a website in which I want select an image to save in a server database. I have an IWFile so I can select from website the file from my local PC but when i confirm I get the error 'cause the file cannot be found (it search the file in the server path and not in the local path (also only root and not the selected path) ). That's my code (tiwedfile is the IWfile component): procedure TRipFormH.IWButton2Click(Sender: TObject); begin usersession.qStart.Ed...

Save image in a blob field
Hi, I've a problem that should be quite simple, I think. But I'm going crazy so I hope that you can help me. I've a website in which I want select an image to save in a server database. I have an IWFile so I can select from website the file from my local PC but when i confirm I get the error 'cause the file cannot be found (it search the file in the server path and not in the local path (also only root and not the selected path) ). That's my code (tiwedfile is the IWfile component): procedure TRipFormH.IWButton2Click(Sender: TObject); begin usersession.qStart.Ed...

Saving Image in Table Field?
Hi All, I have a situation where I have to store an image into a table field. What should be the type of the field and how do I save it, any code examples pls help. Best Regards and many many thanks in advance. Usman This is database dependent. SQL Server and MSDE has an IMAGE field type that would likely be appropriate.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog database is sql, any code example for vb.net how to save and retrieve pls? Regards, Usman Here is a complete example.Starting with ASP.NET 2.0? Look at:Programming Microsoft Web...

Convert Delphi 5 ADO App to Delphi 2007 ADO.NET
I have an appliction tha that is writen in Delphi 5 with ADOConnetion, ADOTable, and ADOQuery components. I need to upgrade to Delphi 2007 and use ADO.NET. I have the program building in with Delphi 2007. Is there anything I need to do to convert the ADO to ADO.NET? > I need to upgrade to Delphi 2007 and use ADO.NET. Why ? -- With best regards, Dmitry Arefiev AnyDAC (www.anydac.com) - Oracle, MS SQL Server, IBM DB2, MySQL, Firebird, Interbase, PostgreSQL, Sybase ASA, SQLite, MS Access, DBX, ODBC, InMem - universal high-speed native data access engine Reasons for ...

how to save image in oracle blob field?
Hello All,I m using vb.net2002-03. Can you tell me the code how to store the image in the oracle blob field?i tried but not succeed..so storing path temporarily..i want to store image it self in to database and also want to reirieve from the blob field...I think i've to read that image in to byte array by giving path and then store the image...and i am using oledb for that and not oracle client and i think to store this i've to add system.oracle client.dll from the add reference of  project menu.so if possible please privide me code snippet in vb.net or provide me any link that con...

How to save an image field on SQL Server?
I am developing on Powerbuilder 6.0 I need to save a register on SQL Server that has a image fiel (blob). When I use ODBC it�s possible but whether I use a direct connection to SQL Server with a native driver of PowerBuilder 6.0 it�s not possible. How can I save it ? Is there any way ? Here is the script which I used: lb_foto = ole_1.ObjectData int li_filenum, bytesread, li_ret string ls_file_name, ls_id blob scanned_blob li_filenum = FileOpen(is_foto,StreamMode!,read!) IF li_filenum = -1 THEN messagebox('','Error abriendo archivo') return else bytes...

Image save through Stored procedure with delphi.
Hi. I am trying to save an image from Delphi through stored procedure. (ASA 6.0.3) In the database table the field type is IMAGE and also in the stored procedure parameters. I tried to work with TTable of Delphi and it is working great. Any idea how to work with Delphi + Stored Procedure + IMAGE? Best Regards. Yossi Zaig. Asakim LTD What version of Delphi? Are you using BDE? asakimrd <asakimrd@netvision.net.il> wrote in message news:$j1hAajn$GA.52@forums.sybase.com... > Hi. > > I am trying to save an image from Delphi through stored procedure...

How to save an image from clipboard to the disk? or How to save an image of dw with graph object to the disk?
How can I do it within powerscript? I have the image of my graph into clipboard dw_1.ClipBoard('gr_1') but I can't save it to the my hard disk? Anybody has any ideas? Use syntax 2 of saveAs : dw_1.saveAs('test', 'gr_1', WMF!, True) On Fri, 10 Jan 2003 04:59:48 -0500, in powersoft.public.powerbuilder.general <Dmitri> wrote: >How can I do it within powerscript? > >I have the image of my graph into clipboard > >dw_1.ClipBoard('gr_1') > >but I can't save it to the my hard disk? > >Anybody has...

Web resources about - How to save and access image field - embarcadero.delphi.ado

Local access and transport area - Wikipedia, the free encyclopedia
Local access and transport area (LATA) is a term used in U.S. telecommunications regulation. It represents a geographical area of the United ...

Dozens of government agencies request access to citizen metadata without warrants
Metadata legislation was meant to reduce access to private records, but it appears non-law enforcement agencies remain hungry for it.

Attorney-General George Brandis appeals decision on access to his diary
... George Brandis is challenging a tribunal's ruling that his office reconsider a request from shadow attorney-general Mark Dreyfus for access ...

Apple asks widow to get court order to access her iPad, locked after her husband's death
Unlike so many of the things David had left for Peggy in his will &mdash; car ownership, the title of the house, basically everything he owned ...

Make your own kid-friendly home internet access
It's not hard to filter out the worst of the internet without installing crippling net nanny software on every device in your home.

Attorney-General George Brandis fights order to reconsider giving Mark Dreyfus access to diary
George Brandis is appealing a tribunal decision forcing him to reconsider a freedom of information request to hand over his diary the Opposition. ...

ISPs try to kill open-access fiber network, avoid competition
... infrastructure and not the "last mile" fiber connections that extend to people's homes and businesses. This network would be open access, however, ...

Netflix starts to block proxy and VPN access
... has already started to impose new restrictions. Some Netflix customers in Autralia who are using the uFlix VPN have noticed that their access ...

Pro-choice groups go on 'offense' to broaden abortion access
... Two pro-choice groups announced Wednesday that they are launching a broad campaign to pass state legislation that will expand women's access ...

Netflix is blocking Australian users who access US content
Last week, Netflix said it would be bringing down the hammer on people who use VPNs (or other similar means) to access geo-restricted content. ...

Resources last updated: 1/22/2016 10:40:09 PM