SET DEFAULT TO or CD not working for my data folder only

Topics: User Forum
Nov 5, 2015 at 12:06 AM
I've been working for a few months on moving a desktop VFP application to ActiveVFP, making good progress, then suddenly this morning I had a serious unsolvable problem.

At first my ajax response was telling me that the tables could not be opened, I added some code and it reported that the tables weren't in the current folder. Up until now I have never changed the current folder, but between last night and this morning it got changed somehow to IIS's program folder.

In MAIN.PRG the data folder is put in SET PATH, so I had spent some time trying to figure out if there was anything wrong with the path, but apparently it just doesn't see the contents of the path. Nowhere in my code did I ever change the current directory or path, certainly not since yesterday.

Anyway, so should change the current directory to the data folder. I should be able to use either SET DEFAULT TO or CD, right?

Actually my path is abstracted (a variable) in the code, but I just need to get this working again. Right now the whole thing is totally hooped because of this problem.

SET DEFAULT TO "C:\Program Files\" &&
CD "C:\NVIDIA\" && works
CD "C:\Downloads\" && works
CD "C:\inetpub\" && works
CD "C:\Temp\" && works
IF DIRECTORY("C:\sandbox\")
**directory is false for hidden or system folders, attributes confirmed not set on sandbox
CD "C:\sandbox\" && still doesn`t work, but it should based on the lines above
**nope: err#=  202 line=    90 Invalid path or file name, even with DIRECTORY=true
ENDIF

This is my sandbox copy not the live data version which is on the company server, that's why the folder is named sandbox. C:\Sandbox is where the data files have been all along actually, like yesterday when this was working. The folder is definitely there. It's network shared with everyone and IIS_IUSRS has full control. DIRECTORY() returns .T. on it, but the path is still invalid somehow?

I'm completely locked out from accessing any of the tables.

I tried restarting my computer.

This makes no sense.
Nov 5, 2015 at 9:20 PM
I worked around this problem by copying all the tables to a new folder, actually I used Temp which just had a few old files in it but I knew I was able to CD to it, renaming the old sandbox folder to sandbox2, and renaming the new folder sandbox. It works now.

However I would really like to know the cause because it occurred suddenly and it could very well occur again. It must be that some property of the folder got set somehow to something that VFP doesn't like, but not either of the two properties in the documentation (hidden or system).