set tableprompt off llError = .f. with this.DataEnvironment for each loCursor in .Objects if loCursor.Class == 'Cursor' try if not Empty(loCursor.Database) open database (loCursor.DataBase) endif use (loCursor.CursorSource) alias test catch llError = .t. finally use in Select('Test') try if not Empty(loCursor.Database) set database to (loCursor.Database) close databases endif catch endtry endtry if llError return .f. endif endif endfor .OpenTables() endwithAll the try catch statements are to make sure the tables/databases/view can be opened, if all succeed, then you call OpenTables to have all the relationships etc, altough now that I mention it, maybe you just clear the DE and (manually, by code) open everything in the OpenTables method of the dataenvironment