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