• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4335
  • Last Modified:

VFP9 Double click on DBF <filename>.dbf gives message "<filename>.fxp is not an object file"

In Windows Explorer, when I double click on a dbf file (of form <filename>.dbf), instead of opening the file in VFP, I get a message "<filename>.fxp is not an object file".

e.g. clicking on T_DCLNT.DBF, gives message  "t_dclnt.fxp is not an object file".

OS is Windows 7 Home Premium 64 bit.

Am unsure what to do as Windows 7 no longer has the Edit File Type tab to edit actions associated with a particular extension or file type.
1
logicalc
Asked:
logicalc
  • 5
  • 5
  • 3
  • +1
2 Solutions
 
Aamir SarfarazIT ManagerCommented:
follow these steps.

NOTE: DON'T FORGET TO CLICK "HELPFUL COMMENTS YES"

   1.

      Click on Start and then Control Panel.

      Tip: In a hurry? Type associations in the search box after clicking the start button. Choose Make a file type always open in a specific program from the list of results and then skip to Step 4.
   2.

      Click on the Programs link.

      Note: If you're viewing the Small icons or Large icons view of Control Panel, you won't see this link. Click on the Default Programs icon and then click on the Associate a file type or protocol with a program link. Then proceed to Step 4.
   3.

      Click on the Make a file type always open in a specific program link under the Default Programs heading.
   4.

      In the Set Associations window, scroll down the list until you see the file extension that you want to change the default program for.
   5.

      Click on the file extension to highlight it, once you've found the one you're looking for.
   6.

      Click the Change program... button above the scroll bar.

      The Open With dialog box should appear.
   7.

      Look through the options in the Recommended Programs area and choose the application that you want to open the file extension with when you double-click on the particular kind of file on your computer.

      Note: Chances are, the applications listed under Recommended Programs will contain the most applicable programs for this file type but be sure to look at the applications under Other Programs. You may need to click the v to expand the list of these programs.

      Note: Click Browse... to search through your computer for any program not listed that you'd like to use.
   8.

      Click the OK button on the Open With window. Windows 7 will refresh the list of file associations to show the new default program to open this type of file.
   9.

      Click the Close button at the bottom of the Set Associations window. You may also close the Control Panel window if it's still open.
  10.

      From this point forward, when you double-click on any file with this particular file extension, the program you associated it with in Step 7 will launch and load the particular file.

      Important: Whatever program used to automatically open when these types of files were launched will still open these types of files. To use another program, you'll just need to start the program manually and then browse your computer for the particular file.
0
 
logicalcAuthor Commented:
Thanks aamsoh, but I already did this. VFP9 is already associated with .dbf files.

The problem is that Visual FoxPro is trying to run the file rather than open it. I need to find how to change this behaviour.
0
 
Aamir SarfarazIT ManagerCommented:

Thankx, EE Zone Advisor,

Actually some people forget to press the buttons after get the right answer.

0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
Aamir SarfarazIT ManagerCommented:
do you want to open this file to modifying structure or open as to read data?
0
 
Olaf DoschkeSoftware DeveloperCommented:
Start cmd via "Run As administrator", then run vfp9.exe /regserver, that should reastablish the correct handling of vfp files including opening up a dbf when double clicking it.

You can even improve that, see here: http://www.berezniker.com/content/pages/visual-foxpro/fix-vfp-file-associations-open-files-one-vfp-instance.

@aamosh, your 10 useful steps work for many file extensions where you only have one possible open action, in foxpro when doing this kind of association the file opened will be started, executed, which means the dbf is treated like a prg, which does not work. Taking these steps even can cause this to happen.

Bye, Olaf.
1
 
logicalcAuthor Commented:
I want to "USE" the file in VFP. On my XP computer when I double-click on a .dbf file, this happens.
0
 
logicalcAuthor Commented:
Thanks Olaf_Doschke. I tried "vfp.exe /regserver" before. Though it did not work, I tried it again - but it still changes nothing.

I had also seen : http://www.berezniker.com/content/pages/visual-foxpro/fix-vfp-file-associations-open-files-one-vfp-instance. I edited the entries to set just those for the section for "table", but again, this did not work.
Windows Registry Editor Version 5.00
 
[HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\command]
@="\"C:\\Program Files\\Microsoft Visual FoxPro 9\\vfp9.exe\""
 
[HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec]
@="open(\"%1\")"
[HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec\Application]
@="FoxPro"
[HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\ddeexec\Topic]
@="System"

Open in new window

0
 
Olaf DoschkeSoftware DeveloperCommented:
You need to run as admin for this to go where it should go, otherwise all the registry entries made by vfp.exe /regserver or the Windows Registry Editor Script will go into the virtualized branch of the registry, where they are useless.

It's not enough to be admin user on Win7 or Vista, this still virtualizes files or registry keys, unless you rightclick and "run as admin".

So create a txt file with the line
"C:\Program Files\Microsoft Visual Foxpro 9\vfp9.exe"/regserver
adjust to your installtion directory, rename the txt to vfpreg.cmd, then right click on it and start it with "Run as Administrator", even if your account is an admin and even if your logged in as "Administrator". This is basic UAC behaviour, it goes for every account to provide better security. You'll need to "Allow" the cmd to run as Administrator (in german it's "Zulassen", I don't know how windows prompts in english) and then it'll go into the right place of the registry.

The same goes for the registry script, only it needs a file extension .reg instead of cmd.

Bye, Olaf.
1
 
logicalcAuthor Commented:
Olaf Doschke, I ran these as administrator, exactly as you suggested, but they did not fix the problem.

Thanks
David
0
 
Olaf DoschkeSoftware DeveloperCommented:
Then I can only recommend to reinstall VFP, as it works from a fresh installation.

Bye, Olaf.
0
 
FEOXCommented:
Have you tried the following registry settings?  The one you provided seem to be missing the "-SHELLOPEN" clause included when VFP 9 is installed.  My installation did not use any "ddeexec" keys.
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.dbf]
@="Visual.FoxPro.Table"

[HKEY_CLASSES_ROOT\Visual.FoxPro.Table\shell\open\command]
@="\"C:\\Program Files\\Microsoft Visual Foxpro 9\\vfp9.exe\" -SHELLOPEN \"%1\""

Open in new window

0
 
Olaf DoschkeSoftware DeveloperCommented:
The registry keys Sergey Berezniker provides are different from the original ones, because they offer the feature of opening a dbf within a running VFP IDE, only opening a new VFP IDE instance, if there is none running. That's why there are DDE entries.

vfp9.exe /regserver does recover the keys as you propose.

Bye, Olaf.

0
 
FEOXCommented:
I noticed that using a Command Prompt to execute this command on a directory with DBF files:

"C:\Program Files\Microsoft Visual Foxpro 9\vfp9.exe" T_DCLNT.DBF

VFP 9 tries to open the file as a program (not as a table).

Adding the "-SHELLOPEN" option to the command automatically opens the T_DCLNT.DBF as a table not as a program:

"C:\Program Files\Microsoft Visual Foxpro 9\vfp9.exe" -SHELLOPEN T_DCLNT.DBF

Maybe it was just the "-SHELLOPEN" option was just missing on the registry.  Not sure if that option is fixed by VFP9.EXE /regserver.

Maybe just adding the "-SHELLOPEN" clause on the registries will fix his problem.
0
 
logicalcAuthor Commented:
You are a star FEOX, well done, this fixed it!

Changing the registry line for the default in HKEY_CLASSES_ROOT\Applications\vfp9.exe\shell\open\command. as you suggested, fixes this.

As I have 64-bit Windows 7, I set the value to:
"C:\Program Files (x86)\Microsoft Visual FoxPro 9\vfp9.exe" -SHELLOPEN "%1"
1
 
Olaf DoschkeSoftware DeveloperCommented:
The behavior to open a DBF as a program comes from answering the question "always open with ..." with yes.

Bereznikers registry settings will fix that, too.

but again, this has to be executed from a cmd.exe elevated, so the registry keys go in the right place and not redirected.

You can't simply store this as reg and double click. This method worked last time on XP, since Vista you need elevation.

Bye, Olaf.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now