Thread View: comp.lang.pascal.delphi.databases
1 messages
1 total messages
Started by Michael Huth
Wed, 07 Apr 1999 00:00
Saving TTreeView in a Database using TBlobStream
Author: Michael Huth
Date: Wed, 07 Apr 1999 00:00
Date: Wed, 07 Apr 1999 00:00
69 lines
3170 bytes
3170 bytes
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------7D5FAD9DA3823A084A3C6AFC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hello there,
I have the following construct, which works a little but not really
properly: I am using a MS Access Database, with the certain table
'EventTree'. 'EventTree' has 3 fields: 'ID' (Auto-Inc), 'Name' (Text),
and 'EventTree' (OLE). In my program I have a form, on which I have
placed a DBGrid (connected only to the 'Name'-field of the
'EventTree'-table) and a TTreeView-component.
What I want to do is to load TTreeView-data from the 'EventTree'-field,
and display it in the TTreeView-component. Of couse, I want to save
changes in the TTreeView-component to the table.
I started to implement this using a TBlobStream. In the procedure 'Load'
I have the following code:
BlobStream:=TBlobStream.Create(TblEventTree.FieldByName(FnEventTree)
as TBlobField,bmRead);
if BlobStream<>nil then TvEventTree.LoadFromStream(BlobStream);
BlobStream.Free;
In the corresponing procedure 'Save' you find the following code-pieces:
with TblEventTree do
begin
Edit;
BlobStream:=TBlobStream.Create(FieldByName(FnEventTree) as
TBlobField,bmReadWrite);
TvEventTree.SaveToStream(BlobStream);
Post;
end;
BlobStream.Free;
As I said, it works a little (loading the event-trees), but as soon as I
save it for the first time, the occur error-messages, when I scroll
through the dataset: 'BLOB already open' and 'BLOB not open'.
In the documentation and in most of the Delphi-literature you hardly
find anything about BlobStreams and how you can use they. If somebody of
you sees what I am doing wrong in my program, please send me corrections
or suggestions.
Thanx,
Mike
--------------7D5FAD9DA3823A084A3C6AFC
Content-Type: text/x-vcard; charset=us-ascii;
name="mhuth.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte f�r Michael Huth
Content-Disposition: attachment;
filename="mhuth.vcf"
begin:vcard
n:Huth;Michael
x-mozilla-html:FALSE
org:Seminar fuer Logistik und Verkehr
adr:;;Mertonstrasse 17 - 25;Frankfurt;;60054;Germany
version:2.1
email;internet:mhuth@wiwi.uni-frankfurt.de
title:Dipl.-Kfm.
x-mozilla-cpt:;0
fn:Michael Huth
end:vcard
--------------7D5FAD9DA3823A084A3C6AFC--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads