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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Fox Pro and Foxbase+ 3.1 DBFs 3

Status
Not open for further replies.

Luiz Eduh

Technical User
Jan 10, 2012
51
US
Hi all,

I need of your help. I have a few dbfs that are used in a foxbase program. I needed to see some data and opened one of them using Visual Fox Pro 9. Right after double clicking the dbf I received a windows titled "Code Page" telling me that the file "....." is not marked with a code page. Please select the code page it was created in. (see screenshot attached) not being sure on what to select I selected MS-DOS and was able to see the data. I made a few changes like deleted a few records. Once I closed the table, I ran the foxbase program and got an error when accessing that dbf. My question is did VFP9 changed the structure of the table? if so how can I revert it back to be able to be readable in FOXBASE.

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=f9999a9f-5e78-4daf-bea1-15509307bd4e&file=popup.jpg
Run CpZero.prg which ships with VFP9.

And to avoid this problem in the future, issue Set CpDialog Off.
 
I have seen this situation a few times over the years. To avoid it, simply put

[tt]SET CPDIALOG OFF[/tt]

at the start of your program. That way, you won't see the dialogue, and VFP won't change the header of the file.

By the way, regarless of the above setting, the dialog only appears if the table is being opened exclusively.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Note that the OP specifically said "Right after double clicking the dbf", implying opening the DBF from Windows Explorer. SET CPDIALOG OFF will only be useful inside the VFP IDE BEFORE opening the file.

I've never been able to find any way to set this in the IDE, but I suspect a config.fpw setting of:

Code:
CPDIALOG=OFF
may take care of it more globally, although I don't have any older files to test this with.
 
Good point, Dan. I hadn't thought of that.

However, there might be a solution. As I mentioned earlier, the problem only arises if the table is opened exclusively (because VFP needs to change the header). Assuming "Open exclusive" is not ticked in the Data tab of the Options dialog, double-clicking the file in Windows should cause it to open in shared mode, which means the problem won't arise.

But, like you, I have no way of testing this. Perhaps Mr Webuxer (OP) can try it and report back to us.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top