Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Reading correct tables
Message
 
À
26/07/2005 13:30:52
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01035975
Message ID:
01035981
Vues:
13
>I have a vfp9 winform that opens some free tables in the Data Environment and displays their information in a grid, etc... Everything in the form works.
>
>My problem is that the tables in the DE are pointing to the production tables located on the F: drive. This is not a real big deal except that I added a field to the table on the development drive T: and also changed the form. However, when I perform a DO FORM myform in the command window, the form's DE opens the table in production on F: and not the one I want in T:.
>
>I even have a path set to my development tables but the form still looks at the production tables.
>
>Is there any way to remove all paths in the form's DE?
>
>I would really like the form's DE CursorSource property to read "mytable.dbf" rather than "f:\data\mytable.dbf". Then I would be responsible for creating the proper SET PATH statement.
>
>Thanks,
>
>Jerry

One way is to hack the form and change hard coded path. The other way:
** In BeforeOpenTables event of the DE.

FOR EACH oObject IN this.Objects
    IF UPPER(oObject.BaseClass) == "CURSOR" AND;
       EMPTY(oObject.DataBase) && Free Table
       oObject.CursorSource = JUSTFNAME(oObject.CursorSource)
    ENDIF
ENDFOR
That way it must open the tables from the PATH you set.
(not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform