Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update Conflict
Message
De
10/10/2000 21:01:08
 
 
À
10/10/2000 19:25:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00427633
Message ID:
00427654
Vues:
15
>I became inspired by Jim Booth's book and decided to use a view for one of my edit screens. The view is a simple combination of two tables. I allow the edit screen to make changes and execute the following code on process.
>
> **************************************************************************************
> *** Save changes
> **************************************************************************************
> TABLEUPDATE(.T.,.T.,"MoveHistoryMaintenance")
> REQUERY("MoveHistoryMaintenance")
> ThisForm.Pageframecustom1.ActivePage = 1
>
>When two or more move records for the same client were involved the Requery generated an Update Conflict error. I reasoned that this was because the Key field I had marked (using eview) was the client id and as this is a foreign key and therefore not unique I removed the check mark. This made the update scream at me about keys. Obviously, I am missing some very important conceptual information about views and updates.
>
>Here is the sql code for the view as specified in eview:
>
>SELECT Movehst.*, Home.h_full_nm FROM main!movehst LEFT OUTER JOIN main!home ON Movehst.home = Home.id WHERE Movehst.id = ?gnChildID AND NOT DELETED() = .T. ORDER BY Movehst.id, Movehst.in_date, Movehst.home
>
>All fields except h_full_nm are marked updateable (I don't want the home name changed as that is maintianed elsewhere).
>
>All help greatly appreciated
>
>Terry
I have more evidence. I found I forgot to release the view on exit from the form (since I 'USED' it in the BeforeOpenTables method of the dataenvironment).
This stopped the update conflict error but the Duplicate record in Key field warning still remains. Over course this is a duplicate it's supposed to be. The primary index for this table is BINTOC(ID,4)+DTOC(Date_In,1)+BINTOC(Home,4) but I can't set that for the view :(

Still confused

Terry
It is impossible to make programs idiot proof. Idiots are too cleaver.

MCP( Tcp/Ip )
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform