Articles   Members Online: 3
-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 a dBase database at runtime 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 a dBase database at runtime 25-Aug-02
Category
BDE
Language
Delphi 2.x
Views
109
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

Create a dBase database at runtime

Answer:

The following procedure may be especially useful for temporary tables:

1   procedure MakeDataBase;
2   begin
3     with TTable.Create(nil) do
4     begin
5       DatabaseName := 'c:\temp'; (* alias *)
6       TableName := 'test.dbf';
7       TableType := ttDBase;
8       with FieldDefs do
9       begin
10        Add('F_NAME', ftString, 20, false);
11        Add('L_NAME', ftString, 30, false);
12      end;
13      CreateTable;
14      { create a calculated index }
15      with IndexDefs do
16      begin
17        Clear;
18        { don't forget ixExpression in calculated indexes! }
19        AddIndex('name', 'Upper(L_NAME)+Upper(F_NAME)', [ixExpression]);
20      end;
21    end;
22  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