>Dear Visual FoxPro users
>
>I have made an executableand and put it in a directory with my database. In the beginning of my program I have done SET DEFAULT "c:\MyApp" and SET PATH c:\MyApp;a:\
>but some how there is a connection between my database in my application and my database in the develping enviroment(c:\vfp\develop). How did I found out. Yesterday I managed to corrupt my database in the develping enviroment, but my database in my applcation is still working. When I ran my application I get an error message saying "The database in invalid...". How can my application know that my database is invalid in my develping enviroment? If I change the directory c:\vfp\develop to c:\vfp\develop_old, my application works just fine. I have done EDIT/FIND in my forms and I can't find any strange SET DEFAULT or SET PATH. Are there any more commands I should know about?
If you used Form.DataEnvironment, and I believe you did it, you set (during development!) Database property for any cursor from DE. So, when you run your form it first tries to find database using exisitng property and then check another path just if not found. The safest way to handle this situation is to have some common method invoked from DE.beforeopentables which reset Database properties to the right path.
Edward Pikman
Independent Consultant