>I am using the following function to see if VFP is already open. If it is I want to use set resource to another foxuser.dbf in another location. Problem is, it always thinks it is the first and trys to use the resource file already open and an error is generated.
>How can I make it see that it is already open.
>
You could use the GETOBJECT() function - if it fails, then it wasn't already open. The GETOBJECT() will throw an "Operation unavailable" error if VFP is not already started.
e.g., from a one file app I have tested this with..
LOCAL loVFP, llErr
ON ERROR llErr = .T.
loVFP = GETOBJECT(,"VisualFoxPro.Application")
IF !llErr
MESSAGEBOX("VFP started.")
ELSE
MESSAGEBOX("VFP not started.")
ENDIF
ON ERROR
RELE ALL
Insanity: Doing the same thing over and over and expecting different results.