>Doug,
>
>>I am having a little trouble trying to add a record using a simple form created from cBizObjForm. I have minimal controls on the form with one business object that loads one view. I have a button that calls the forms New() method, which in turn calls the business objects new method. The business object appends a blank record to the view and then calls the OnNew() method which will retrieve the setting for the default value of the primary key and evaluate it.>
>
>>Well, when using DBGETPROP() to retrieve the default value of the primary key, I am getting the error "No database is open or set as the current database". However, when I check the results of DBC() or SET("DATABASE"), they both return the name of the current database.>
>
>Are you setting a breakpoint and checking the value of SET('DATABASE') from within the OnNew() method? If VFP is giving you this error, it usually means what it says (although this is *not* the case for some other VFP errors!).
>
>Regards,
Actually, I discovered the problem this morning. The oSessionEnvironment object wasn't getting instantiated before all other business objects. The reason is because oSessionEnvironment isn't a part of RefBizObj any more, so I was forgetting about it.
Thanks for the help though.
Doug Stalter
Doug Stalter
"According to the proverb, the best things are the most difficult." -Plutarch