Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CLOSE DATABASES ALL does not close a database
Message
From
18/04/2001 17:40:26
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
CLOSE DATABASES ALL does not close a database
Miscellaneous
Thread ID:
00497036
Message ID:
00497036
Views:
44
Hello, All

Do you know why the command CLOSE DATABASES ALL does not close the current database?

After some messages here in the UT, I was convinced to switch to Private DataSession. But, as you surely know, the SET DATABASE is scoped to the current datasession. So, to not be forced to issue every time the command SET DATABASE TO some_database, I've created a property in the global app object, where I've stored the name of the current database. Also, the property have an ASSIGN method, with the following code:
LPARAMETERS vNewVal
IF ALLTRIM(vNewVal) == ""
	SET DATABASE TO ""
ELSE
	IF DBUSED(vNewVal)
		SET DATABASE TO (vNewVal)
	ELSE
		OPEN DATABASE (vNewVal)
	ENDIF
ENDIF
THIS.DATABASE = DBC()
RETURN vNewVal
Thus, every time I've store something in the property, this method will try to set the database or to open it.

In the .Load event of my form base class, I have the following line of code:
SET DATABASE TO (oApp.DATABASE)
------------------------------------

These are all the different things as I've worked before. But at this moment, if I issue the CLOSE DATABASES ALL command everywhere in the form, the current database doesn't close. It becomes unselected, but not closed.

Can somebody enlighten?

Thank you
Grigore Dolghin
Class Software.
Next
Reply
Map
View

Click here to load this message in the networking platform