Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set database anomoly
Message
From
01/06/2018 12:28:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Set database anomoly
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012 R2
Network:
Windows Server 2012 R2
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01660504
Message ID:
01660504
Views:
67
Hi all,

This is weird as it has not shown up in the framework I use before. Two forms based on same class and one works fine, the other has a problem at a certain part in the code.

For the 2nd one, it fails to open a local view programmatically because it turns out that no database is set at the point when this code runs i.e. SET("Database") returns blank. On the original form, in the code in about the same spot, the database is open and set; but in the 2nd form, it is not. I can work around it by inserting a SET DATABASE TO xx command but I cannot figure out what is causing the database to be set to blank.

When I first open each form and go to the debug window, they are both set correctly. I tried setting a breakpoint for when this changes but it fires so often in the debugger I gave up.

Question: are there any commands or situations where the database is implicitly closed? much like the database is implicitly set to the correct database when you issue OPEN DATABASE xx.

Also, is there any other way to track all the changes to SET("Database") other than the debugger?

Thanks,
Albert
Next
Reply
Map
View

Click here to load this message in the networking platform