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

File Association Problem (2 Vers of VFP installed)

Status
Not open for further replies.

DanEvansJr

Programmer
Aug 17, 2001
41
0
0
US
I have VFP6 installed and running happily. This morning, after a wild hair got up my butt, I installed VFP9, which has now taken over all of my file associations (.prg, .dbf, .pjx, etc.). When I double click on a foxpro file, VFP9 starts up. Normally, this wouldn't be a problem, but VFP6 is still our main development tool here.

If I right-click on the file and use the Open With dialog to choose VFP6, it will open with an error:
.dbf files open in a modify window and give a syntax error as if it's attempting to run a .prg
.pjx files give an 'is not an object file' error.

Even if I go to the Tools -> Folder Options -> File Types and set the associations to VFP6, it still gives the above errors.

I remember this problem happening when I had VFP8 installed briefly and the only way to correct it was to completely uninstall VFP8, completley uninstall VFP6, and then re-install VFP6. I don't want to go through that again.

Anyone experience this? Is there a solution (other than uninstalling)? I'd really like to be able to run 6 and 9 on my machine simultaneously, if that's possible.

Thanks in advance to anyone that can help.
 
Unless you edit all the associations, I don't see that you have a choice but to uninstall/reinstall.
I have VFP 6, 7 and 9 installed on my machine and I have no problems with any of them. But, I never double-click to open any of the files. I open whichever version of VFP I need, then open the files from the command window.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 

Dan,

With most recent versions of VFP, you can overcome this problem by running VFP's setup and choosing the Repair option. Do this for the version whose associations you want to restore.

Unfortunately, I no longer have VFP 6.0 installed, and can't remember if it has a Repair option. If it doesn't, the best solution would be to uninstall 6.0, then re-install it.

(Actually, the best solution would be to stay with 9.0, but I assume you already considered that.)

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Dan,

Start VFP6 with the command-line option "/regserver" (w/o quotes) from a run box. ie.

"c:\program files\Microsoft Visual Studio\vfp98 /regserver"

Regards,

Mike
 
Thanks everyone, but the only solution that worked was COMPLETELY uninstalling 9 and 6, cleaning the registry and then doing a fresh install of 9, and then a fresh install of 6. When I doubleclick on a .dbf or pjx file, it opens with VFP 6 which is what I wanted.

One small thing, when I right-click and open a table using VFP9, it will open, but open AGAIN. As in open the same table twice, giving the second instance a generic tablespace 'B'. No big deal. I'm not going to screw with anything any longer.
 
Batch this up as a program to swap as needed...

Brian

Code:
DO associatefile  WITH "PRG", "Microsoft Visual Foxpro 7", "C:\Program Files\Microsoft Visual FoxPro 7\vfp7.exe"

PROCEDURE associatefile (sExtension, sFileDescription, sExecutable)
    LOCAL sErrorHandler
    sErrorHandler = ON("error")
    ON ERROR @1,1 say ""&&Necessary since the regdelete lines will error out if it doesn't exist
    oShell  = CreateObject("wscript.shell")
    oShell.Regwrite ("HKCR\" + sExtension + "\", sFileDescription)
    oShell.Regwrite ("HKCR\" + sFileDescription + "\", sFileDescription)
    oShell.Regwrite ("HKCR\" + sFileDescription + "\DefaultIcon\", sExecutable)
    oShell.Regwrite ("HKCR\" + sFileDescription + "\shell\open\command\", sExecutable + " %1")
    oShell.Regdelete ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + sExtension + "\Application")
    oShell.Regwrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + sExtension + "\Application", sExecutable)
    oShell.Regdelete ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + sExtension + "\OpenWithList\")
    oShell.Regwrite ("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\" + sExtension + "\OpenWithList\a", sExecutable)
    ON ERROR &sErrorHandler
ENDPROC 
[/code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top