Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updatable Views
Message
De
10/03/1998 10:47:58
 
 
À
09/03/1998 11:06:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00083366
Message ID:
00083633
Vues:
23
>Thanks for the response. I've have already tried all you suggested. I guess what I failed to mention was that when I modify a record in the view, everything works fine. The base table gets updated properly. It is when I insert a record in the view I get "Uniqueness of index ID has been violated". I assigned a unique ID to the new record prior to inserting it in the view. When I click 'Ignore' the new record still get's inserted. What is causing this error? Below is my SQL statemnt for creating the view:
>
>SELECT NVL(tt_IdDesc,"Invalid transact ID") AS tt_idDesc, mx_ID, mx_Date, mx_FinSize, mx_SrcID, mx_SrcType, mx_Ac_ID, mx_tt_ID, mx_tt_Code, mx_AShares, mx_FX_ID, mx_FX_Rate, mx_Module, mx_Descr, mx_New, mx_PostAmt, mx_Reviewd
>FROM mTrnsAct INNER JOIN TranType ON tt_ID == mx_tt_ID
>WHERE mx_SrcID == ?nCo_ID ORDER BY mx_Date
>
>My CURSORSETPROP()'s are:
>TABLE : mTrnsAct
>KEYFIELDLIST : mx_ID
>UPDATABLEFIELDLIST : (all except tt_IDDesc)
>SENDUPDATES : .T.
>BUFFERING : 3
>
>Everything works fine for my single table views. What am missing?

I have received that error before, but it was not in the view. It was the index in the base table that was causing it. When using a view, the key fields that you select in the Update Criteria Tab of the view needs to be the same fields that are in your index of your base table. This is how Visual finds the correct record to update. The Index also has to be a "Primary" index.

When I received this error it was because the record I created was not unique, according to my index. I would check your index to make sure it is right. If you insert a record in your base table from the command window and you get the same error, then that would probably be it. To help fix mine, in the Table designer, for the fields in the table that were part of my index, I used the Default Value option to ensure that the key fields got filled properly. That way, I knew they were not blank when a new record was inserted. It could be that for a moment, your base table record is either blank, or contains a value that another record in your table also includes (based on your index).

Let me know if this helps.

John Henry
John Henry
State of Michigan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform