|
Home > Archive > FoxPro database connector > September 2005 > Close Database - VFP 9 - Changed
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Close Database - VFP 9 - Changed
|
|
| devendra 2005-07-29, 8:25 pm |
| There is a change in Close database function in VFP9.
Once, a database is opened in a form, it can be closed only when a form is
closed. This major change has been indicated only by way of note in help
topic of Close Database.
Is not fair for MS to document every change that is made from earlier
version at a place where one can find it easily ? It helps the developer to
know what is changed and he can assess its implications.
This changed has ruined my all developments hitherto made. For my general
accounting application, different company can be selected in one form. What
I am doing on selecting on new company, I close old databse and open databse
from new directoy. It is working very fine till VFP 9. Now as in VFP 9 due
to chnage in Close Database behavior, as old databse cannot be closed,
requerrying is not properly functioning and giving very odd results.
Is there is any workaround to close database in a form ?
And one question arises in my mind that If a database cannot be closed in a
form, what is the use of close databse function ? Database is always closed
when a form is released. Moreover what prompted VFP team to change this
behavior ?
Thanks in advance.
Devendra
| |
| Fred Taylor 2005-07-30, 3:24 am |
| What are you talking about? CLOSE DATA closes the current database just
fine, same as it always has. I see no such note in Help about being unable
to CLOSE DATABASE from within a form.
--
Fred
Microsoft Visual FoxPro MVP
"devendra" < dcjariwala@sancharne
t.in> wrote in message
news:erS1mlKlFHA.2396@TK2MSFTNGP12.phx.gbl...
> There is a change in Close database function in VFP9.
>
> Once, a database is opened in a form, it can be closed only when a form is
> closed. This major change has been indicated only by way of note in help
> topic of Close Database.
>
> Is not fair for MS to document every change that is made from earlier
> version at a place where one can find it easily ? It helps the developer
> to
> know what is changed and he can assess its implications.
>
> This changed has ruined my all developments hitherto made. For my general
> accounting application, different company can be selected in one form.
> What
> I am doing on selecting on new company, I close old databse and open
> databse
> from new directoy. It is working very fine till VFP 9. Now as in VFP 9 due
> to chnage in Close Database behavior, as old databse cannot be closed,
> requerrying is not properly functioning and giving very odd results.
>
> Is there is any workaround to close database in a form ?
>
> And one question arises in my mind that If a database cannot be closed in
> a
> form, what is the use of close databse function ? Database is always
> closed
> when a form is released. Moreover what prompted VFP team to change this
> behavior ?
>
> Thanks in advance.
>
> Devendra
>
>
>
>
| |
| Cindy Winegarden 2005-07-30, 3:24 am |
| Hi Devendra,
Are you perhaps referring to this from the Close All topic?
Note:
Using CLOSE DATABASES in the Command window does not close a database if the
database was opened in the Project Manager by expanding its node or when a
form is running in its own data session. Under these circumstances, the
database remains open until the Project Manager closes the database or until
the form using the database closes.
<<
Are you testing in the Fox development environment or when running from an
EXE?
--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@msn
.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden
"devendra" < dcjariwala@sancharne
t.in> wrote in message
news:erS1mlKlFHA.2396@TK2MSFTNGP12.phx.gbl...[color=darkred]
> There is a change in Close database function in VFP9.
>
> Once, a database is opened in a form, it can be closed only when a form is
> closed. This major change has been indicated only by way of note in help
> topic of Close Database.
>
> Is not fair for MS to document every change that is made from earlier
> version at a place where one can find it easily ? It helps the developer
> to
> know what is changed and he can assess its implications.
>
> This changed has ruined my all developments hitherto made. For my general
> accounting application, different company can be selected in one form.
> What
> I am doing on selecting on new company, I close old databse and open
> databse
> from new directoy. It is working very fine till VFP 9. Now as in VFP 9 due
> to chnage in Close Database behavior, as old databse cannot be closed,
> requerrying is not properly functioning and giving very odd results.
>
> Is there is any workaround to close database in a form ?
>
> And one question arises in my mind that If a database cannot be closed in
> a
> form, what is the use of close databse function ? Database is always
> closed
> when a form is released. Moreover what prompted VFP team to change this
> behavior ?
>
> Thanks in advance.
>
> Devendra
>
>
>
>
| |
| devendra 2005-07-30, 8:24 pm |
| Yes. The same Note.
I am testing in the development environment.
Is there any different behaviour for development and Running EXE
environment.
"Cindy Winegarden" < cindy_winegarden@msn
.com> wrote in message
news:O6cl5mMlFHA.3968@tk2msftngp13.phx.gbl...
> Hi Devendra,
>
> Are you perhaps referring to this from the Close All topic?
> Note:
> Using CLOSE DATABASES in the Command window does not close a database if
the
> database was opened in the Project Manager by expanding its node or when a
> form is running in its own data session. Under these circumstances, the
> database remains open until the Project Manager closes the database or
until
> the form using the database closes.
> <<
>
> Are you testing in the Fox development environment or when running from an
> EXE?
>
> --
> Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
> cindy_winegarden@msn
.com www.cindywinegarden.com
> Blog: http://spaces.msn.com/members/cindywinegarden
>
>
> "devendra" < dcjariwala@sancharne
t.in> wrote in message
> news:erS1mlKlFHA.2396@TK2MSFTNGP12.phx.gbl...
is[color=darkred]
general[color=darkre
d]
due[color=darkred]
in[color=darkred]
>
>
| |
| devendra 2005-07-30, 8:24 pm |
| The note in Close Database function is as below.
Using CLOSE DATABASES in the Command window does not close a database if the
database was opened in the Project Manager by expanding its node or when a
form is running in its own data session. Under these circumstances, the
database remains open until the Project Manager closes the database or until
the form using the database closes.
You can verify also by just Set Step On, Close Database and Set in a Form.
Devendra
"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:OvABA1KlFHA.3544@TK2MSFTNGP15.phx.gbl...
> What are you talking about? CLOSE DATA closes the current database just
> fine, same as it always has. I see no such note in Help about being
unable
> to CLOSE DATABASE from within a form.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "devendra" < dcjariwala@sancharne
t.in> wrote in message
> news:erS1mlKlFHA.2396@TK2MSFTNGP12.phx.gbl...
is[color=darkred]
general[color=darkre
d]
due[color=darkred]
in[color=darkred]
>
>
| |
| Stefan Wuebbe 2005-07-31, 3:24 am |
|
"devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
news:O6lWLQWlFHA.2472@TK2MSFTNGP15.phx.gbl...
> Yes. The same Note.
>
> I am testing in the development environment.
>
> Is there any different behaviour for development and Running EXE
> environment.
No, as Fred and Cindy pointed out, the behavior of the "Close
Databases" command did not change, only the online help text
was improved.
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| Fred Taylor 2005-07-31, 8:24 pm |
| So what's your problem then? Is the database open in the Project Manager?
--
Fred
Microsoft Visual FoxPro MVP
"devendra" < dcjariwala@sancharne
t.in> wrote in message
news:eb%23NPQWlFHA.2472@TK2MSFTNGP15.phx.gbl...
> The note in Close Database function is as below.
>
> Using CLOSE DATABASES in the Command window does not close a database if
> the
> database was opened in the Project Manager by expanding its node or when a
> form is running in its own data session. Under these circumstances, the
> database remains open until the Project Manager closes the database or
> until
> the form using the database closes.
>
> You can verify also by just Set Step On, Close Database and Set in a Form.
>
> Devendra
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:OvABA1KlFHA.3544@TK2MSFTNGP15.phx.gbl...
> unable
> is
> general
> due
> in
>
>
| |
| devendra 2005-07-31, 8:24 pm |
| Does it mean that Close Database behaviour is the same as that of VFP 8 ?
Devendra
"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:#ucNeialFHA.1044@tk2msftngp13.phx.gbl...
>
> "devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
> news:O6lWLQWlFHA.2472@TK2MSFTNGP15.phx.gbl...
>
> No, as Fred and Cindy pointed out, the behavior of the "Close
> Databases" command did not change, only the online help text
> was improved.
>
>
> -Stefan
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
| |
| devendra 2005-07-31, 8:24 pm |
| No. In EXE while running application.
Devdndra
"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:#LeHKSglFHA.2180@TK2MSFTNGP15.phx.gbl...
> So what's your problem then? Is the database open in the Project Manager?
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "devendra" < dcjariwala@sancharne
t.in> wrote in message
> news:eb%23NPQWlFHA.2472@TK2MSFTNGP15.phx.gbl...
a[color=darkred]
Form.[color=darkred]
just[color=darkred]
form[color=darkred]
form.[color=darkred]
9[color=darkred]
closed,[color=darkre
d]
closed[color=darkred
]
>
>
| |
| Fred Taylor 2005-07-31, 8:24 pm |
| Nothing about CLOSE DATABASE has changed that I'm aware of. Only the help
file was changed to better reflect what it actually does.
--
Fred
Microsoft Visual FoxPro MVP
"devendra" < dcjariwala@sancharne
t.in> wrote in message
news:%23lHQjDjlFHA.3316@TK2MSFTNGP14.phx.gbl...
> No. In EXE while running application.
>
> Devdndra
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:#LeHKSglFHA.2180@TK2MSFTNGP15.phx.gbl...
> a
> Form.
> just
> form
> form.
> 9
> closed,
> closed
>
>
| |
| Stefan Wuebbe 2005-08-01, 11:25 am |
|
"devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
news:eJqu6CjlFHA.1948@TK2MSFTNGP12.phx.gbl...
> Does it mean that Close Database behaviour is the same as that of VFP 8 ?
> Devendra
Yes, I think so too. The particular effect that you cannot close a
database being opened by another instance, like private datasessions
at runtime or the project manager in the IDE, did not change since
VFP5 at least.
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| devendra 2005-08-01, 8:26 pm |
| Yes. I have checked. In VFP 8 also, the same behavior.
But now If I want close dtabase in form, how can I close it ?
Devendra
"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:Ok#5LrqlFHA.2180@TK2MSFTNGP15.phx.gbl...
>
> "devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
> news:eJqu6CjlFHA.1948@TK2MSFTNGP12.phx.gbl...
?[color=darkred]
>
> Yes, I think so too. The particular effect that you cannot close a
> database being opened by another instance, like private datasessions
> at runtime or the project manager in the IDE, did not change since
> VFP5 at least.
>
>
> hth
> -Stefan
>
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
>
| |
| Stefan Wuebbe 2005-08-02, 3:24 am |
|
"devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
news:eDJN6FvlFHA.3120@TK2MSFTNGP09.phx.gbl...
> Yes. I have checked. In VFP 8 also, the same behavior.
>
> But now If I want close dtabase in form, how can I close it ?
How does your scenario look like? Assumed it requires closing
databases to try to do some maintenance stuff, running only every
other month, a typical approach would be to "CloseAllForms()"
of the current instance beforehand, e.g.
Proc CloseAllForms() && pseudo code
Local lnForm
For lnForm = _screen.FormCount To 1 Step -1
_screen.Forms(m.lnForm).Release()
EndFor
Return ( _screen.FormCount = 0 )
EndProc
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| devendra 2005-08-02, 8:26 pm |
| It means that Database cannot be closed from a form.
If a form is not running, no user interface would be available while closing
databse.
Devdndra
"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:#76jYHylFHA.3336@tk2msftngp13.phx.gbl...
>
> "devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
> news:eDJN6FvlFHA.3120@TK2MSFTNGP09.phx.gbl...
>
> How does your scenario look like? Assumed it requires closing
> databases to try to do some maintenance stuff, running only every
> other month, a typical approach would be to "CloseAllForms()"
> of the current instance beforehand, e.g.
>
> Proc CloseAllForms() && pseudo code
> Local lnForm
> For lnForm = _screen.FormCount To 1 Step -1
> _screen.Forms(m.lnForm).Release()
> EndFor
> Return ( _screen.FormCount = 0 )
> EndProc
>
>
>
> hth
> -Stefan
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
>
| |
| Stefan Wuebbe 2005-08-03, 3:26 am |
|
"devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
news:Og9oPF8lFHA.3900@TK2MSFTNGP09.phx.gbl...
> It means that Database cannot be closed from a form.
>
> If a form is not running, no user interface would be available while closing
> databse.
Not necessarily, there are probably a lot of ways -
you can for example modify the sample code from the previous
posting to exclude the current form.Name.
Or run the code in a menu procedure right before you instantiate the
maintenanceForm.
Or have a custom "Form Manager" object, which can be useful
anyway, keeping track of all instances of your dataForm class,
e.g. in oDataForm.Init() register by sending a reference.to
oFormManager.to be stored in a oFormManager.customCollection
and unregister in oDataForm.Destroy()
That way you can tell your form manager to try to release all
dataForms etc.
hth
-Stefan
--
|\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------
| |
| devendra 2005-08-08, 8:26 pm |
| Thanks for reply.
Devendra
"Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
news:esm8sh$lFHA.3568@tk2msftngp13.phx.gbl...
>
> "devendra" < dcjariwala@sancharne
t.in> schrieb im Newsbeitrag
> news:Og9oPF8lFHA.3900@TK2MSFTNGP09.phx.gbl...
closing[color=darkre
d]
>
> Not necessarily, there are probably a lot of ways -
> you can for example modify the sample code from the previous
> posting to exclude the current form.Name.
>
> Or run the code in a menu procedure right before you instantiate the
> maintenanceForm.
>
> Or have a custom "Form Manager" object, which can be useful
> anyway, keeping track of all instances of your dataForm class,
> e.g. in oDataForm.Init() register by sending a reference.to
> oFormManager.to be stored in a oFormManager.customCollection
> and unregister in oDataForm.Destroy()
> That way you can tell your form manager to try to release all
> dataForms etc.
>
>
> hth
> -Stefan
>
>
> --
> |\_/| ------ ProLib - programmers liberty -----------------
> (.. ) Our MVPs and MCPs make the Fox run....
> - / See us at www.prolib.de or www.AFPages.de
> -----------------------------------------------------------
>
| |
| Anders 2005-09-13, 1:25 pm |
| If the Project Manager is holding the database open, select the database on
the Data tab of the PM and use the Close button on the same page to close
it. The only thing hghat's new here is that the Help spells it out.
-Anders
"devendra" < dcjariwala@sancharne
t.in> skrev i meddelandet
news:eDJN6FvlFHA.3120@TK2MSFTNGP09.phx.gbl...
> Yes. I have checked. In VFP 8 also, the same behavior.
>
> But now If I want close dtabase in form, how can I close it ?
>
> Devendra
>
> "Stefan Wuebbe" <stefan.wuebbe@gmx.de> wrote in message
> news:Ok#5LrqlFHA.2180@TK2MSFTNGP15.phx.gbl...
> ?
>
>
|
|
|
|
|