corrupt table how to fix?

pervasive 2000

i have never used pervasive , i once used btrieve back in the gwbasic days (a lot of time eh?)
i am mostly into oracle,vb,mssql and other, but not pervasive,

The problem is a friend wich has no idea of nothing hehe, got a corrupt table and their frontend system is crashing, so she viewed the data using some pervasive tool, and says data from the last record "JUMPED FIELDS"
that is data from one field appeared in another and so on, the data jumped to the next field in the table, so data that should be on a field date appeared in another field, data from some numeric id, appeared in a description field, etc
i tought this was a development bug, but she said she has being using that system for two years without problems , and even if it was, the how could DATE data get into another field 8maybe in pervasive is possible, but not in other DBMS i know),
the question:
how to repair that table or the  database?
how to invoke the repair utility if there exists one?
or how to manually deal with the problem?

HAVE TRIED: copying all data to another table but she cannot! (some error about indexes being wrong ), she cannot delete that last record also
so i think that she shold REPAIR , but she does not know how, neither do i

HELP PLEASE, i know it is not much info, but she is not a tech user, and she is not in my city, so if you need to know anything, just ask me , so i can ask her :)

LVL 12
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sounds like there's no backup? 1st make a copy of the file.

Then, go to a dos prompt and type
butil -stat database.btr

This will give you the number of records in the file. Write it down or do butil -stat database.btr>allrecs.txt to save to a file.

Go to a dos prompt and type
butil -save database.btr database.sav

This will save all the records into a sequential ASCII file, even the damaged ones. You might use this later to repair corrupt records.

Go to a dos prompt and type
butil -recover database.btr database.rec Make a note of the number of records recovered.

This will save all the non-corrupt records into a sequential ASCII file.

Go to a dos prompt and type
butil -clone database.cln database.btr

This will make a blank file with the same structure as the original file.

Go to a dos prompt and type
butil -load database.rec database.cln

This will insert the recovered records into the blank file.

Rename database.btr to

Copy database.cln to database.btr

Use the Pervasive tool or the app to check the database.

Or you can zip the file and e-mail to me. Good luck.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aranaAuthor Commented:
thanks for the info.

what about rebuilding indexes? and DDF?
The recover and load should take care of the indexes. The DDFs will not need to change as long as the file is in the same directory as before.
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

aranaAuthor Commented:
THANKS A LOT, this was going ok, as you said and as she expected, at the asmetime their system provider was helping them and they finished very quick (it cost a lot also, but was not my money or hers hehe),

your answer is good and was doing the job, my friend is not so good, and she was slower than the service provier, anyhow thanks for the info, since thanks to it NOW I KNOW at least two things about pervasive  and how it works

1.- it can be fixed
2.- stay away from it!   :P :D
Pervasive rocks! It's the fastest around. I have customers with over 20 million records in a DB and they get sub-second retrievals. But, if you don't know what you are doing, stay away.

Note: The database should be faster and smaller now that she rebuilt the indices.

Why did they pay someone?
L PCommented:
Thank you so much for this article.  I tested on a file with a status 2 Disk I/O error and managed to recover 108013 records out of 108015.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

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.