How to rebuild Indexes in database file

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.
Who is Participating?
kretzschmarConnect With a Mentor Commented:
hi again,

well i will point you first to

there is all what you need for repairing

for backup two methods

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

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

     //With VCL-Methods
     procedure TForm1.Button2Click(Sender: TObject);
       Table2.DatabaseName := 'c:\Tmp';
       Table1.IndexDefs.Update;  //Retrieve IndexInformation
       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;

for which database (paradox,access,sql)?
mvalezAuthor Commented:
in Paradox...

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

mvalezAuthor Commented:
in Paradox...

mvalezAuthor Commented:
in Paradox...

mvalezAuthor Commented:
in Paradox...

yup, in paradox ;-)
mvalezAuthor Commented:
Can you give me a complete program code for it?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.