main logo
Subject: Re: cBizObj and Free Tables
Author: James H. Hansen
Posted: 2001/07/06 21:18:23
 
View Entire Thread
New Search


<i><font color="#663300"><i><font color="#663300">I am having a problem constructing business objects based upon free tables.

cBizObj saves changes the datasource cursor by calling up the hierarchy to cDataBehavior.save() which in turn relies upon .CheckForUpdateConflicts() and .ConflictCheck(). In the latter method, a call is made to native VFP routine Refresh(), which results in an Error #1491. Apparently this is because the cursor is not formed from an SQL query.

The CB error handler does a nice job of trapping this error, and the changes are in fact saved to the table. However...

I dont' see any attempt, anywhere in the Save() process, to test the datasource to prevent this error. Wouldn't this also break if I were using a view based on local tables? Am I missing it?

My proposed solution is to perform a CURSORGETPROP() test in my bizobj method, and then pass thru only if required. Comments anyone?
</font></i>

I noticed that problem too. I've just copied the method to the ilevel, adding nodefault at the top and then I replaced:

REFRESH()

by:

IF CURSORGETPROP("SOURCETYPE") # DB_SRCTABLE
REFRESH()
ENDIF


</font></i>

I just spent a couple hours figuring this out for tables in a database. Once I figured out what the problem was, I knew what to search for in this forum. Unfortunately, I wasted a lot of time changing my BizObj to use iTableBehavior and then scratching around to find out why the <i>lCheckForUpdateConflicts</i> property of iTableBehavior changed at runtime from what was set in the definition.

Is there some plan to fix this?
Jim Hansen
Canyon Country Consulting
 
©2001 James H. Hansen
<-- Prior Message New Search Next Message -->