Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy value from 1 field to another in the dbc
Message
De
29/07/1998 09:39:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00122106
Message ID:
00122275
Vues:
20
If you have a better approach, I'd love to hear it!

I have a couple of fields (product.desc, product.value) in some tables that appear to be SQL keywords. My forms use views/tableupdate(). The tableupdate() generates an error whenever I change the "desc" or "value" field (I think the code it generates is something like UPDATE product SET desc = "foo", instead of UPDATE product SET product.desc = "FOO" which would work).

It is a tremendous amount of work to rename the field, due to legacy systems.

Many solutions have been bounced around, but I've had luck with only 2:
* make the "desc" field non-updatable in the view, and then manually stuff the value in after the tableupdate() - this works, but scares me (and is ugly for child tables using table buffering)
* use the dbc to keep the fields mirrored - the legacy code can reference "desc" while the GUI forms can reference "cDesc"


The mirrored field idea seems to work fine (implementing the synchronization during the record-level rule). But, documentation seems to imply I shouldn't be doing this.

I know the "clean" solution is simply to rename the field. But, this is a real-world app, and that just isn't possible. So, I'm looking for the best possible work-around.


Bob

>Just out of curiosity... any particular reason why would you want to do something like this. I am sure there is one.... but maybe there is a better approach.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform