Greetings!

In one piece of my application, my active work area contains a view. A new
record is being added to the view. If I exit this piece without doing
anything to the new record, the view remains active and I get an error
saying "Cannot insert an empty row from a view into its base table(s)". I
click Cancel and my application exits. The view is still showing in my Data
Session window. When I click on it in the Data Session window and click
Close, I get the same error. When I issue "Close All", I get the same
error. When I click the X in the top right corner to exit FoxPro, I get the
same error! The only way to get this view to go away is to use Task Manager
to shut down FoxPro!

Is there a more graceful way to recover?

Thanks very much!

Rob Richardson, who will now go back and make sure the view never has a
blank row.

Re: "Cannot insert an empty row" error locks up VFP 8.0! by Jack

Jack
Mon May 24 12:02:53 CDT 2004

On Mon, 24 May 2004 11:57:23 -0400, "Rob Richardson"
<notreally@n2net.net> wrote:

>Greetings!
>
>In one piece of my application, my active work area contains a view. A new
>record is being added to the view. If I exit this piece without doing
>anything to the new record, the view remains active and I get an error
>saying "Cannot insert an empty row from a view into its base table(s)". I
>click Cancel and my application exits. The view is still showing in my Data
>Session window. When I click on it in the Data Session window and click
>Close, I get the same error. When I issue "Close All", I get the same
>error. When I click the X in the top right corner to exit FoxPro, I get the
>same error! The only way to get this view to go away is to use Task Manager
>to shut down FoxPro!
>
>Is there a more graceful way to recover?

To discard the changes you have made to the view:
=TABLEREVERT(.T., "yourview")

To close the view:
USE IN SELECT("yourview")

Once you make changes to a view, VFP will try to commit those changes
to the backend before the view is closed. You need to explicitly
discard the changes if you don't want them committed.

After making changes to a view, you should always call either
TABLEUPDATE or TABLEREVERT.