Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to store TForms and / or their properties in a Paradox blob field Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
30-Aug-02
Category
DB-General
Language
Delphi 2.x
Views
81
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

How to store TForms and / or their properties in a Paradox blob field

Answer:

1   procedure SaveToField(FField: TBlobField; Form: TComponent);
2   var
3     Stream: TBlobStream;
4     FormName: string;
5   begin
6     FormName := Copy(Form.ClassName, 2, 99);
7     Stream := TBlobStream.Create(FField, bmWrite);
8     try
9       Stream.WriteComponentRes(FormName, Form);
10    finally
11      Stream.Free;
12    end;
13  end;
14  
15  procedure LoadFromField(FField: TBlobField; Form: TComponent);
16  var
17    Stream: TBlobStream;
18    I: integer;
19  begin
20    try
21      Stream := TBlobStream.Create(FField, bmRead);
22      try
23        {delete all components}
24        for I := Form.ComponentCount - 1 downto 0 do
25          Form.Components[I].Free;
26        Stream.ReadComponentRes(Form);
27      finally
28        Stream.Free;
29      end;
30    except
31      on EFOpenError do {nothing}
32        ;
33    end;
34  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC