Armin,
I tried to duplicate the problem you're experiencing by clearing the cInitialSelectedAlias property of a data environment and then instantiating the business object, but I couldn't get it to fail.
At any rate, I've changed the code in CDataEnvironment.SetInitialSelectedAlias() as follows:
ELSE
IF EMPTY(This.InitialSelectedAlias) AND ;
this.InitialSelectedAlias = this.aCursors[this.nInitialSelectedAlias]
ELSE
IF NOT EMPTY(taDataAccessObjects[1])
This.InitialSelectedAlias = SUBSTR(taDataAccessObjects[1],2)
ENDIF
ENDIF
This.cInitialSelectedAlias = this.InitialSelectedAlias
ENDIF
Let me know if this works for you!
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com