Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to rebuild Indexes in database file

Posted on 1999-06-25
8
Medium Priority
?
211 Views
Last Modified: 2010-04-06
How can i :
1. Rebuild Indexes
2. Saved or fixed corrupt database file
3. Make backup on a database file
can you give me a source code for it or a free component
to do that one.
0
Comment
Question by:mvalez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1384507
for which database (paradox,access,sql)?
0
 

Author Comment

by:mvalez
ID: 1384508
in Paradox...

0
 

Author Comment

by:mvalez
ID: 1384509
in Paradox...

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mvalez
ID: 1384510
in Paradox...

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 1384511
hi again,

well i will point you first to
http://www.borland.com/devsupport/bde/utilities.html

there is all what you need for repairing

for backup two methods


     //Copy with wildcards Help-Function
     Function CopyFiles(Source, DestPath : String; OverwriteExisting : Boolean) :
     Integer;
     var
       SRec : TSearchRec;
       OK : Integer;
     begin
       OK := 0;
       If FindFirst(Source,faAnyFile,Srec) = 0 Then
       repeat
         if not copyFile(PChar(ExtractFilePath(Source)+SRec.Name),PChar(DestPath
     + SRec.Name),OverwriteExisting) then
           ok := GetLastError;
       until (Findnext(SRec) <> 0) or (OK <> 0);
       FindClose(Srec);
       Result := OK;
     end;

     //FileCopy
     procedure TForm1.Button1Click(Sender: TObject);
     begin
       Table1.Close;
       if CopyFiles('C:\hadaten\contact.*','C:\tmp\',true) = 0 then
         Showmessage('Copied')
       else
         Showmessage('Copy failed');
     //  Table1.DatabaseName := 'C:\tmp';
     //  Table1.Open;
     end;

     //With VCL-Methods
     procedure TForm1.Button2Click(Sender: TObject);
     begin
       Table2.DatabaseName := 'c:\Tmp';
       Table2.FieldDefs.Assign(Table1.FieldDefs);
       Table1.IndexDefs.Update;  //Retrieve IndexInformation
       Table2.IndexDefs.Assign(Table1.IndexDefs);
       Table2.TableName := Table1.TableName;
       Table2.CreateTable;  //create table with indexes
       Table2.BatchMove(Table1,BatAppend);  //append all to the new empty table
     //  Table2.Open;
     //  Datasource1.DataSet := Table2;
     end;

meikl
0
 

Author Comment

by:mvalez
ID: 1384512
in Paradox...

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1384513
yup, in paradox ;-)
0
 

Author Comment

by:mvalez
ID: 1384514
Can you give me a complete program code for it?

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question