Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert/View password protected dbf fpt cdx files?

Status
Not open for further replies.

pho3nix2010

Programmer
Aug 10, 2010
4
US
My background: MS Access, SAS programming. Foxpro - no experience.

Case background: Received .dbf .fpt .cdx files from an institution to import into our Access database for research. Sender is medical savy, not data savy.

What I learned so far: I am guessing these files are Foxpro extensions based on dBase origin. Some files are index files, others metadata maybe and then data files. The files came from a system called SensorMedics.

What I attempted so far: Tried various .dbf converters, MS Excel and Access to open. Have not tried Foxpro yet as I do not have software nor experience.

Problem and Question: Some converters and even Access was able to open and but required a password to view or advance. Is the password something a user generated on the other parties' side or is it an algorithm generated by the software using Foxpro as the data backend or am I completely missing the boat? Thanks for any assistance. Otherwise, all data will have to be manually entered along with the associated human error and time.
 
No DBFs are pure TXT files with a header.
There is no way to password protect them.
You could try to open them with Excel, Some ADO (but you should install VFPOLEDB provider).

Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Thank you bborissov for your response. Could you elaborate why a popup box requesting a password would appear? As my post states, MS Excel was one of the tools used to open all three extensions. A password dialogue resulted.
 
Hi Pho3nix2010,

Welcome to the forum.

First, you can easily check that a DBF file is indeed a FoxPro table.

Open the DBF file in a text editor, such as Notepad. If it's a FoxPro file, the first character will probably be "1", "2" or possibly another number or letter. This will be followed by 31 characters of "garbage" (actually binary values, but not recognisable in Notepad). You will then see a list of field names, all in capital letters. This is followed by the actual data, which you should be able to recognise.

If the file roughly fits that description, then it's probably a FoxPro file.

As Borislav says, thre's no way to password-protect a FoxPro file. But Access tends to prompt for a password whenever it tries to open a file it doesn't understand. I've also seen that happen with FoxPro files in Crystal Reports.

One reason might be that the data also requires another set of files, with extensions DBC, DCT and DCX. These are the actual "database" files. Not all FoxPro data needs these, but if it does, you can't (easily) open them without.

Another possibility is that your software (Access, Excel or whatever) is an old version, and doesn't work with the more recent flavours of FoxPro data. Taht would be the case if it uses the old FoxPro ODBC driver, which hasn't been updated for a long time. More recent versions of the software use an OLE DB provider instead.

If none of this helps, perhaps you can find someone who has Visual FoxPro, and have them open a sample of your data, just to check that it is indeed FoxPro data and is not corrupted in any way.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Is there a dbc file? That would be the only point where code could run when opening a table or the database. A password dialog is not native, but can be custom made using that events.

If you don't have a DBC, the password prompt must come from somewhere else than from the DBFs. I wonder if Access did not simply misinterpret some files you treid to open.

As Borislav said, you don't need foxpro itself but the foxpro OLEDB provider:
With that you should be able to connect from Access like with any other OLEDB provider to other remote data. You know better than me how to connect to remote data from Access. OLEDB may not be that familar as ODBC.

DBF are the main file of each table, the files you access or open, CDX are index files, FPT are for Memo,Blob and other fields of varying length. We typically talk of DBFs only, even if they are acompanied by the other files.

Metadata about tables and indexes is in the header of these files and in a DBC you might also find, otherwise you have free or 2.x and older version tables. As Excel can't open them it's a sign you have something newer. The first byte of a DBF indicates it's type.

DBF is a little more than TXT with a header, that is a simplyfication, Integers eg are stored as 4 byte long binary data. Date, datetime etc are also such binary fields in that respect, so you can't in general use a dbf as a csv or sdf file after removing it's header. If it only has char fields, then this is possible, but I'd say access via the right driver is much easier, isnt it?

Bye, Olaf.
 
"Have not tried Foxpro yet as I do not have software nor experience."

Well perhaps we can help there...
Depending on how OLD the Foxpro data tables are you might be able to use the FoxPro for Windows 2.6a found at:
If the data tables are from a newer version of Visual Foxpro, this most likely will not work, but it's worth a shot.

Under what circumstances do you experience:
"Could you elaborate why a popup box requesting a password would appear?"
* What software are you attempting to use?

If it is the Vendor's software itself, then they have some user/password 'security' built into the application, but, while it may prevent you from running the application, it would not prevent you from accessing the separate data tables directly with Foxpro (or some other means).

There is also an outside possibility that the Vendor encrypted the individual field data within the data table in some manner. If so then I'd suggest that you contact them to acquire the decryption algorithm.

Good Luck,
JRB-Bldr
 
JRB-Bldr,

What you say about the vendor having password-protected the files sounds plausible. As you and I know, there's nothing native in VFP that would cause a password prompt.

However, that wouldn't explain why Access is prompting for a password. In that case, would you agree that it's likely either that Pho3nix2010 is using an old version of Access (using the old ODBC driver), or is trying to use a DBF without a DBC, or the DBF is corrupted?

I admit that's only a guess. It's difficult to know without knowing all the circumstances.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thank you everyone for your kind suggestions. Before I try some of the advice given, I would like to clarify the situation if I can. As noted in my original post, the 3 files, .dbf .fpt .cdx are the only files received, thus no dbc file. I am assuming the software the 3 types of files came from is old since they had to copy the data onto a old 3.5 floppy disk so they could transfer to a newer machine.

I will try the OLEDB provider suggested. Unless Excel and Access 2007 is considered old and unable to open, I think it should work. Also it is possible there may have been a dbc file but the sender (not computer savy) did not know to send this file.

The circumstance in which the popup window for a password occurs on opening the file within Excel or Access. It seems like it is going to work then the password dialogue back comes up. I also thought it may be possible the fields are encrypted but like everyone else is saying it is highly unlikely. But then again, it could be similar to an Access backend (tables) file being able to contain a password to open within Access.

The other programs I tried were pretty much a google search and all the dbf converters. I tried some that also had a password dialogue occur. I contacted the sender to give me the contact info for SensorMedics so I could possibly talk to their techs for some insight.

Thanks again everyone and I will let you know how the suggestions fair.
 
Unless Exce and Access 2007 is considered old".

The problem is vice versa: Office products capability to use DBF files was never updated from way back, when they supported what are now old dbf formats only. So you cannot open newer versions of DBFs no matter how new the Excel or Access version is. Here's mere Microsft left the office software to not be compatible with newer versions of foxpro and foxpro tables.

While the way you got your files indicates it's an old database, it may be a new enough or even an older DOS DBF, which Excel and Access2007 can't open.

As you don't have a DBC file stored procedures and open table event cannot be the reason for your prompt.

If it's a DBF belonging to a DBC, then in fact a DBC, DCT, DCX file set is misssing. Also you will get a prompt when opening such a DBF, as it points back to the DBC databse file. The prompt would then ask if you want to remove the reference to the DBC file.

As already you can identify the type of DBF from the first byte of the DBF file. USe a hex editor to find out the first byte. See here
Bye, Olaf.
 
Postpho3nix2010 - what you did not mention was if you picked up the Abandonware copy of Foxpro 2.6 for Windows as I suggested above (at the VetsUSWare.com site) and tried to look at the DBF file with it.

That would be my No. 1 suggestion.

If you do that and still have problems then we can address those issues, but if it works then you can come back and ask us about how to handle things from there.

Good Luck,
JRB-Bldr
 
Okay, looks like I need help with Foxpro. I installed the OLEDB as Borislav suggested from MS site along with the sample programs and data. Tried to open the sample programs and it was garbage. I think I am not using OLEDB right. The abandonware copy was also unsuccessful. Using the HxD hexeditor, I got the attachment. Again trying to open in Access still prompted for a password and Excel stated it could not open protected files. Somehow I am thinking I am not using the tools correctly or something. The OLEDB download from MS site had the same type of files in their samples as what I had.

 
 http://www.mediafire.com/i/?hift06t1jsqv660
pho3nix2010:

The F5 in the first byte of your screenshot indicates your DBF is a "FoxPro 2.x (or earlier) with memo", there must be a FTP file, a DBF with memo is incomplete without that.

OLEDB Provider does come with one or more CHM help files with code inside for different languages, eg also .NET and VBA, you should look inside that, sample programs are perhaps foxpro, not of interest for you.

Bye, Olaf.

 
"Okay, looks like I need help with Foxpro."

If you need help with FOXPRO, then forget about the OLEDB for the time being.

Install the Foxpro that I showed you above and then Launch it.

Then with it running you will enter commands into the small Command window which will open the data table(s).

Then with them open you can do a variety of things with the information.

Let us know when you are ready to try and we will try to assist you.

Good Luck,
JRB-Bldr
 
sorry, it's FPT file, not FTP file. Your DBF lacks an FPT file.

Access might display a password prompt, because it errors on opening the dbf without the fpt, then this is misleading.

There are tools like cryptor protecting dbfs, but then the header would look different in a hex editor and opening without cryptor initilisation would return error 15 "is not a table".

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top