Re:Paradox Table not in edit mode - a Philosophy
Quote
gdav...@cirrus.co.za (Glyn Davies) wrote:
>I have been working on a database app for a while and keep running into the
>'table not in edit on insert mode' etc. I know how to fix this by adding
>Table1.Edit;
>BUT, what I can't get my mind around is the philosophy of how this works. Do I
>need to put the table into Edit mode in every procedure I define. What puts
>the table back into browse mode apart from post?
The table will be in Edit mode if you explicitly set it as in your
example, or if the user has started entering data and you have
AutoEdit on your DataSource set to true. If you need to change the
contents of a field in your code this can be confusing, since you can
not assume that the table is in Edit mode. The only solution that I
can suggest is to always preceed any changes to fields with
If not Table1.State in [dsInsert, dsEdit] then Table1.Edit;
After you Post your changes or move to another record (which also
posts your change) the table will be in Browse mode.
The only advantage I can see to having to set Edit mode explicitly is
that until the table is in Edit mode there are no locks against the
record, which would affect access in a multi-user environment.
Quote
>If I open a table on
>Form.Activate, does it stay open until I say Form.Close? Will it stay open
>even after the form has been closed?
I close my tables in the OnClose event procedure since the form still
exists after closing until it is Released. This means that the table
component still exists. Please notice that closing a table does not
automatically cause a Post.
Phil