Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to globally change the name of a table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00365405
Message ID:
00365532
Vues:
23
>I have one table that MUST change its name in the database.
>What would be the easiest way to change the reference to that table in all the forms and reports ?
>
>thanks
>eric

Open the SCX and FRX as a table and do something like the following:
lnRetVal = adir(aForms, "*.SCX")
for j = 1 to lnRetVal
    lcForm = aForms(j,1)
    use (lcForm) excl
    set filter to "OLDNAME" $upper(methods)
    locate
    if !eof()
       browse
    endif
    set filter to "OLDNAME" $upper(properties)
    locate
    if !eof()
       browse
    endif
    use
    compile form (lcForm)
endfor
return
Note that I do not automatically use code to do a STRTRAN() on the old name to the new name. What if old name is not used as a reference to that table and should not be changed? In the browse you can look at the code yourself and use the Search/Replace to selectively change the references yourself.

From the above example, you can do something similar with reports.
Mark McCasland
Midlothian, TX USA
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform