locked
Close data all won't close database. RRS feed

  • Question

  • Hi;

    I'm having problems cloing my main database from within forms. The form's datasession is default.

    close data all would work perfectly fine from within a prg but when I try to run it from within a click of a button on a form, or from the init of a form it won't close the open database.

     

    Any ideas?

     

    Thanks.

    Monday, February 2, 2009 2:51 PM

Answers

  • OK... I found the problem.

    I have a 'roadmap' form which is open by default (This is the 'visual menu' users click on to open different parts of the program). This form does not open any tables and won't set the database. But it is set with a private data session (Inherited). I've found that for some reason while this form (And probably any other form) is open, 'close data all' will not close the database.
    So obviously my solution is that the backup and restore forms will automatically close this roadmap form before they do their deeds...

    My understooding from the help file was that close data all should also close things in other datasessions / forms.

    Thank you all for your feedback.

    • Marked as answer by Aleniko2 Wednesday, February 4, 2009 3:19 AM
    Wednesday, February 4, 2009 3:19 AM

All replies

  • Hi,

    It's better to use by alais names will give the solution for your problem.


    U.PARANTHAMAN
    Monday, February 2, 2009 3:46 PM
  • No - I mean the database container (dbc) stays open.

    ie:

    close database all
    ? dbused("somedbc")   - returns .T.


    Monday, February 2, 2009 7:08 PM
  • Alen - why do you want CLOSE DATA ALL in a form?

    Tamar
    Monday, February 2, 2009 9:30 PM
    Answerer
  • I am trying to do a close database in a backup form (Users use it to backup their data). For some reason close data all won't close my database container and as a result the backup fails.
    I would do the same in my 'restore' form. Users go into the restore screen and click restore to restore their data from a backup set. Again, the database container would stay open even after close data all.

    thx.
    Tuesday, February 3, 2009 3:56 AM
  • Hi,

    I also faced the same problem. But I forget.  Also

    Close all
    Clear all

    will close your Database completely, But you can check by giving

    Close All
    Use

    But Iam not sure.


    U.PARANTHAMAN
    Tuesday, February 3, 2009 6:01 AM
  • Close all wont close as well. Also, close all closes stuff I don't want to close.  It basically closes all except what I want it to close.

    Tuesday, February 3, 2009 6:50 PM
  • Try selecting your database first:

    SET DATABASE TO Whatever
    CLOSE DATABASE

    Also, are you by any chance testing this with the Project Manager open and this database included in the project? That'll definitely fail.
    Tamar
    Tuesday, February 3, 2009 9:58 PM
    Answerer
  • OK... I found the problem.

    I have a 'roadmap' form which is open by default (This is the 'visual menu' users click on to open different parts of the program). This form does not open any tables and won't set the database. But it is set with a private data session (Inherited). I've found that for some reason while this form (And probably any other form) is open, 'close data all' will not close the database.
    So obviously my solution is that the backup and restore forms will automatically close this roadmap form before they do their deeds...

    My understooding from the help file was that close data all should also close things in other datasessions / forms.

    Thank you all for your feedback.

    • Marked as answer by Aleniko2 Wednesday, February 4, 2009 3:19 AM
    Wednesday, February 4, 2009 3:19 AM