Link to home
Start Free TrialLog in
Avatar of lepricon
lepriconFlag for Nigeria

asked on

How do I view the contents of BTR files without the Pervasive/Btrieve Engine

I have a BTR file which I need to export the contents or at least provide read access (either programatically or manually), but I do not have any Pervasive SQL or Btrieve Engine installed. How can I view the contents of the files?
ASKER CERTIFIED SOLUTION
Avatar of Mirtheil
Mirtheil
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lepricon

ASKER

I have downloaded a trial from there., but I get an error while trying to open the files.

How do I create an ODBC DSN?
What error?

Do you have DDFs (FILE.DDF, FIELD.DDF, and INDEX.DDF) in the same directory as the BTR file you want to read?

A better description than I could write on creating DSNs / Database Names:
http://docs.pervasive.com/products/database/psqlv10/wwhelp/wwhimpl/js/html/wwhelp.htm#href=uguide/using.3.5.html
The error is "error 30 on btrv open"

Yes I do, I have the listed DDF files but I have tons of BTR files. i am not sure which iof the BTR files uses the DDF files

Reading the link you posted above, it seems I need to have the server engine installed?

Pardon my naivety. This is my first time working with BTR files.
Actually the steps are the same for both the workgroup and server engine.  

The status 30 indicates that the file is not a Btrieve file. Either it is very corrupt or really isn't a Btrieve file.  What tool are you using when you get that error?  

Btrieve files don't require DDFs but some access methods do (like ODBC, OLEDB, ActiveX, etc).  The DDF files describe the BTR files to other interfaces (like ODBC, OLEDB, etc).  If you used pure Btrieve, DDFs are not needed.  
I am using the Pervasive Data Parser. I am attaching a screenshot
btr.png
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also, check the Task Manager.  Check for W32MKDE.EXE and W3DBSMGR.EXE.  Which one is running?  
The status 30 could also indicate an older engine is trying to open a newer format file.  
I have w3dbsmgr.exe running. Is it possible the BTR file is password protected?
If it had a password, it would return a status 51.  Did Function Executor return the status 30 also? What does Notepad show?
I opened the BTR file in notepad, screenshot attached
btr-screen.png
Function Executor also could not open. Screenshot attached
bexec-screen.png
Function Executor is returning a 3012 which is different than a status 30.  

What exactly did you install in terms of Pervasive PSQL?  Was it the Workgroup Engine?  If so, did you install as a tray app or as a service?  

I downloaded the client (PSQL-Client-10.30.022.000-win.x86) and Data Tools (PVDataTools-9.2.1.42.1-setup). I am currently downloading the server engine (PSQL Server).
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Client doesn't include an engine and can't access files. Once the Server engine downloads and is installed try the Function Executor again.  If it can open the file, then try the Data Parser.  It should work at that point.  

I think the status 30 in Data Parser is a red herring and the error may be truncated.  
I will try that and get back to you. Have to leave the office and head home. Will reconnect as soon as I get home.

Thank you for your time so far.

PS: For some reason, the jimkyle.com site is unavailable to me. Will try it when I get home
Downloaded the server installation and ran the function executor again. Screenshot attached
function-executor.png
OK -- so you're in the file now.  Click on the StepFirst Button (it looks like this: |< ) and it should load the first record for you.  

To export this data to a UNF file, start the Pervasive Maintenance Utility, then select Data/Save and enter the file name and a UNF file name.  A UNF file will consist of a number representing the record length, a comma, and then that number of bytes, followed by a CR/LF pair.  You can then parse this file to get the raw records.

If you have data dictionary files, as Mirtheil suggests, then you should also be able to access the data from ODBC.  First, start the Pervasive Control Center.  Right click on Databases and select New/Database.  Supply the path to your data files (and DDF's) and it should load the definitions for you.  You can then click right on the tables to view data, or right-click and select Export Data... to use the Wizard.


Like I said earlier, I have some DDF files but I am not sure which of the BTR files they define. I am currently running the maintenance utility. Will reply as soon as it completes.
In many cases, the DDF files contain definitions for ALL files in the database.  However, sometimes they are empty ones that were created by mistake, too.
I loaded the PCC as advised but came up with an "empty" database containing just one table which had no records
Look for another set of DDF's.  If you don't have any, then you'll either need to create the table definitions on your own, and just interpret the raw UNF file.

Here's a link which might help:
http://www.goldstarsoftware.com/papers/Accessing%20Btrieve%20Data%20From%20ODBC%20or%20Other%20Applications.pdf
I had to split the points as such because mirtheil's solutions helped me to start while BillBach's comment pointed me to a solution that simplified the process. I also used an application from ClassicSoftware.com that seemed like a GUI version of Dsave from BillBach's comment. I had already been able to view raw data from Mirtheil's comments.

Thank you.
I was able to view raw data using Mirtheil's solutions while I was able to export the raw data using the DSave application suggested by BillBach, though it did not work on large files. Could not export a 2gb file.

I also used an application from classSoftware.com (Data Manager) that seemed like a GUI of DSave