Subject | Re: [IBO] Blob-Error |
---|---|
Author | Helen Borrie (TeamIBO) |
Post date | 2002-01-29T00:49:35Z |
At 11:19 PM 28-01-02 +0100, you wrote:
reading the blob:
...
var
mailstream: TIB_BlobStream;
begin
mailstream:= TIB_Blobstream.CreateForColumn(dmx.q_mail.InternalDataset.Fields['MAIL'], bsmread); <--- notice the extra 's' here
mailstream.AssignTo(memo1.lines);
mailstream.free;
writing the blob:
...
var
docXstream: TIB_BlobStream;
begin
...
if not dmx.q_mail.Prepared then dmx.q_mail.Prepare;
...
docXstream:= TIB_Blobstream.CreateForColumn(dmx.q_mail.InternalDataset.Fields['MAIL'], bsmwrite); <--- notice the extra 's' here
docXstream.Assign(memo2.lines);
q_mail.post
docXstream.free;
...
Another alternative:
..
if not dmx.q_mail.Prepared then dmx.q_mail.Prepare;
..
with dmx.q_mail.InternalDataset.Fields['MAIL'] as TIB_ColumnBlob do
begin
Clear;
Assign(memo2.lines);
end;
I *think* it might be possible to avoid dealing with InternalDataset by using FieldByName('MAIL') instead - this surfaces some methods of the InternalDataset to the TIBODataset...but I'm just not sure whether it works for these particular methods...
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com
>hi list,The TBlobStream class is defined in the dbTables unit of the VCL, which uses the BDE...so dbTables can't be used with IBO components. Use a TIB_BlobStream instead, but the code is not identical because TIB_Blobstream has a lot more "smarts" than TBlobStream:
>with TQuery i used following:
>
>q_mailMAIL field has Blobtyp: ftBlob
>(i tried also ftMemo)
>
>reading the blob:
>
> mailstream:= TBlobstream.create(dmx.q_mailMAIL, bmread);
> memo1.lines.loadfromstream(mailstream);
> mailstream.free;
>
>writing the blob:
>
> q_mail im insertstatus
> ....
> docXstream:= TBlobstream.create(dmx.q_mailMAIL, bmwrite);
> memo2.lines.savetostream(docXstream);
> docXstream.free;
> ...
> q_mail.post
>
>with TIBOQuery i got a Typ-Error, what can i do?
reading the blob:
...
var
mailstream: TIB_BlobStream;
begin
mailstream:= TIB_Blobstream.CreateForColumn(dmx.q_mail.InternalDataset.Fields['MAIL'], bsmread); <--- notice the extra 's' here
mailstream.AssignTo(memo1.lines);
mailstream.free;
writing the blob:
...
var
docXstream: TIB_BlobStream;
begin
...
if not dmx.q_mail.Prepared then dmx.q_mail.Prepare;
...
docXstream:= TIB_Blobstream.CreateForColumn(dmx.q_mail.InternalDataset.Fields['MAIL'], bsmwrite); <--- notice the extra 's' here
docXstream.Assign(memo2.lines);
q_mail.post
docXstream.free;
...
Another alternative:
..
if not dmx.q_mail.Prepared then dmx.q_mail.Prepare;
..
with dmx.q_mail.InternalDataset.Fields['MAIL'] as TIB_ColumnBlob do
begin
Clear;
Assign(memo2.lines);
end;
I *think* it might be possible to avoid dealing with InternalDataset by using FieldByName('MAIL') instead - this surfaces some methods of the InternalDataset to the TIBODataset...but I'm just not sure whether it works for these particular methods...
regards,
Helen Borrie (TeamIBO Support)
** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at www.ibobjects.com