Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error while DE is reloaded by DE.Opentables()
Message
From
08/04/1999 14:15:49
 
 
To
08/04/1999 14:10:43
Noman Aftab
Embry-Riddle Aeronautical University
Daytona Beach, Florida, United States
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00206562
Message ID:
00206565
Views:
20
>HI!
>I have three identical databases with exact same tables. Lets say first is 'A', second 'B' and third 'C'. Initially DE was populated by tables from 'B'. When I try to switch to 'A' or 'C' or even try to start in 'A' or 'C' I get an error saying, "File l:\...\..\B doesn't exist". I checked the procedure several times which replaces the database name with currently open database, either being 'A' or 'C', and debugged it several times. The database names and other properties are replaced without any problem but when VFP reloads DE by DE.Opentables() it gives me the error.
>
>I am including the procedure for switching databases.
>PLEASE HELP!
>
>* Stores current database
>cDbcpathname = dbc()
>
>IF THISFORM.PageRefreshAvailable
> * Closes all tables in dataenvironment
> Thisform.DataEnvironment.CloseTables
>ENDIF
>
>* creates an array with names of the member properties
>=AMEMBERS(laProplist, THISFORM.DataEnvironment, 2)
>
>* Stores length of the array
>nArraylen = ALEN(laProplist, 1)
>
>* returns to calling program if DE is empty
>IF EMPTY(laProplist[1])
> RETURN
>ENDIF
>
>* loops to look through the contents of an array
>IF nArrayLen > 0
> FOR IDcount = 1 TO nArraylen
> cObjname = EVAL('THISFORM.DataEnvironment.' + laProplist[IDcount])
> * changes cursor's reference database path to current database path
> IF LOWER(cObjname.Baseclass) = 'cursor'
> IF !EMPTY(cObjname.Database)
> IF ATC('Aircraft', ALLTRIM(cObjname.Name), 1) = 0
> cObjname.Database = cDbcpathname
> ELSE
> cObjname.Database = THISFORM.ArenaDirPath + ;
> 'Aircraft\Aircraft.dbc'
> ENDIF
> ELSE
> IF ATC('Directory', ALLTRIM(cObjname.Name), 1) = 0
> cObjname.CursorSource = THISFORM.DataTablePath + ;
> 'freetables\' + cObjname.Alias + '.dbf'
> ELSE
> cObjname.CursorSource = 'C:\MPD2000\DIRSELECT\' + ;
> cObjname.Alias + '.dbf'
> ENDIF
> ENDIF
> ENDIF
> NEXT
>ENDIF
>
>* Opens all tables in dataenvironment
>Thisform.DataEnvironment.OpenTables
>
>* removes any filter on main table and moves
>* record pointer to first record
>SET FILTER TO
>LOCATE

I guess that during this process you can get in troubles by any bound control on your form.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform