Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View not updating
Message
De
31/12/1999 13:37:12
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00310882
Message ID:
00310973
Vues:
26
Create the view, run you DGSETPROPs and then run GENDBC versus the database and see what *it* thinks the settings for that view are. The cut (Ctrl+C) the code related to view creation and properties out of the GENDBC output and put it into a separate PRG. Edit the PRG so that the settings are to yoru liking (I'm sure you'll see the problem there) and save/compile. Run it.

>I have a curious question. I am creating a view based off of four tables, only one of which I would actually like to update. The other three simply provide some fields that are displayed for the user. However, when I create the view in a program file rather than the view designer, the fields used to link the primary table to the three lookup tables cannot be updated. The solution is to go into the view designer and set the Update Table property to the name of the primary table. I have tried doing this using DBSETPROP('ViewName', 'VIEW', 'Tables', 'mydb!mytable') but it doesn't seem to have any effect. I have included the code I use to create the table. If anyone has any suggestions, please let me know.
>
>
>Thanks,
>Justin Spies
>
>
>
>
>VFP Code:
>CREATE SQL VIEW lv_Requests AS ;
> SELECT Requests.RequestID, ;
> Requests.Action, ;
> Requests.CustomerID, ;
> Requests.LocationID, ;
> Requests.VaultID, ;
> Requests.MediaID, ;
> Requests.ImportID, ;
> Requests.Tape, ;
> Requests.Slot, ;
> Requests.Outdate, ;
> Requests.Description, ;
> Requests.HasContents, ;
> Requests.DisasterTape, ;
> Requests.Transmit, ;
> Requests.Verified, ;
> Requests.EnteredBy, ;
> Requests.Entered, ;
> Requests.UpdatedBy, ;
> Requests.Updated, ;
> Customer.Code, ;
> Customer.Desc, ;
> Vaults.VaultNumber, ;
> Vaults.VaultName, ;
> Mediatyp.mediatype ;
> FROM vaultkpr!requests, vaultkpr!customer, ; vaultkpr!vaults, vaultkpr!mediatyp ;
> WHERE Requests.CustomerID == Customer.ID AND ;
> Requests.VaultID == Vaults.VaultID AND ;
> Requests.MediaID == MediaTyp.MediaID AND ;
> BETWEEN(Requests.EnteredBy, ?vp_StartUserID, ?vp_EndUserID)
>
>DBSETPROP('lv_Requests', 'VIEW', 'Tables', 'vaultkpr!requests')
>DBSETPROP('lv_Requests.CustomerID', 'FIELD', 'UPdateName', 'requests.customerid')
>DBSETPROP('lv_Requests.MediaID', 'FIELD', 'UpdateName', 'requests.mediaid')
>DBSETPROP('lv_Requests.VaultID', 'FIELD', 'UpdateName', 'requests.vaultid')
>DBSETPROP('lv_Requests.RequestID', 'FIELD', 'KeyField', .T.)
>DBSETPROP('lv_Requests.RequestID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.CustomerID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.LocationID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.VaultID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.MediaID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.ImportID', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Tape', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Slot', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Description', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.HasContents', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.DisasterTape', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Code', 'FIELD', 'Updatable', .F.)
>DBSETPROP('lv_Requests.Desc', 'FIELD', 'Updatable', .F.)
>DBSETPROP('lv_Requests.VaultNumber', 'FIELD', 'Updatable', .F.)
>DBSETPROP('lv_Requests.VaultName', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.MediaType', 'FIELD', 'Updatable', .F.)
>DBSETPROP('lv_Requests.EnteredBy', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Entered', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.UpdatedBy', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests.Updated', 'FIELD', 'Updatable', .T.)
>DBSETPROP('lv_Requests', 'VIEW', 'SendUpdates', .T.)
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform