Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Close database
Message
 
 
To
22/05/2002 16:37:45
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00660148
Message ID:
00660251
Views:
7
>>>I know this is going to sound kind of weird without going into detail...but I have an application running with it's usual database. I then open tables from another database within the application, which in turn opens that database. When I am done with it I need to close the second database. How can I specify that database to close so that the app doesn't close the main database?
>>>
>>>TIA!
>>
>>Searching through the help, there seems to be nothing similar to SELECT DATABASE. Perhaps OPEN DATABASE, for an already open database, would select the desired database?
>
>
>SET DATABASE specifies the name of an open database to be made the current database. I guess I can use that and then use CLOSE DATABASE. Does anyone know whether or not this will work?

Yes, it would.

BTW, we have the same problem here and since I'm not responsible for classes update and my colleague was tight with lots of other problems, it's still unresolved. Basically, each form has to clean after itself, so, if it opens table from a database and this database was not opened before, it should be closed. Unfortunately, VFP doesn't do it automatically, so it should be done on the form's level. Here is another complication: form class could not have DE coded. I personally always open tables programmatically in the code, because I want to take control on some error situations. However, my colleague does it in DE.

So, I'm guessing, form's property aDBOpenedBefore = ... would not probably work... Anyway, this is the only solution, I can think of now. I discussed this problem here before, but didn't get a satisfactory answer...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform