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 create and destroy DBISAM in-memory tables as needed 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
Create and destroy DBISAM in-memory tables as needed 28-May-03
Category
Database Others
Language
Delphi 3.x
Views
154
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Tomas Rutkauskas

When I have deleted an in-memory table and I want to create it again, I get an 
error message that I have duplicate field names. What is wrong here?

Answer:

This automatically creates and destroys memory tables as needed. Use these 
procedures to open and close your tables.

1   procedure OpenTbl(Tbl: TDBISAMTable);
2   begin
3     if (Tbl.Active = False) then
4     begin
5       with Tbl do
6       begin
7         try
8           if not (Exists) and InMemory then
9             CreateTable;
10          Open;
11          First;
12        except
13          raise EOpenTable.Create('Error: couldn' t open table.('+Tbl.TableName+':
14            '+Tbl.Name+')');

15    end;
16      end;
17    end;
18  end;
19  
20  procedure CloseTbl(Tbl: TDBISAMTable);
21  begin
22    with Tbl do
23    begin
24      if (Active = True) then
25      begin
26        if (state = dsInsert) or (state = dsEdit) then
27        begin
28          try
29            Post;
30          except
31            Cancel;
32          end;
33        end;
34        Tbl.FlushBuffers;
35        Close;
36        if InMemory then
37        begin
38          try
39            DeleteTable;
40          except
41            { ... }
42          end;
43        end;
44      end;
45    end;
46  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