Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't Append!
Message
De
19/01/2001 01:56:11
 
 
À
18/01/2001 23:06:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00465557
Message ID:
00465571
Vues:
20
There are some points I need to mention:

1) Tableupdate() Command give you Return value that it is successful update or not!
You need to check it carefully.
If it really return Fail to update, Generally, This cursor would be a BAD cursor.
You can do any tableupdate() success even you revert the data back..
Thus, you need to close the cursor (even the form, application) and restart it to make it work.

2) CursorSetProp() Cmd Only Need set Once just after the cursor is created.
If you try to use this cmd again to change the buffering,
it will auto try to Tableupdate() all data, that will be a problem if there exist conflict..
similiar to above situation. More than 1 user editing the first record...


Thus, Setup the Buffering before the Form appear to user..
Most best setup place is at Form Data Environment in Form designer or code in Form.Load event!





>I have a database and a customer table in it. There is no unique,primary nor candidate key for the table,
>just several regular indexes. When i issued following code to append the table:
>
>=CursorSetProp("Buffering",5,"Customer")
>Insert into Customer (Fields) values (Values)
>Begin Transaction
>=TableUpdate(.T.,.T.,"Customer")
>End Transaction
>
>There is no record appended to the table and if i issue "set order to ..." command and browse the table,
>I got "Index does not match the table. Delete the index file and re-create the index" message.
>
>Then i tried several method to re-create the index:
>1. Issue command "Reindex".
>2. Issue command "Delete Tag All", then "Index on" each regular index field to re-create index.
>3. Just delete the .CDX file, then Validate the database, then "Index on" each regular index field to re-create index.
>The table looks fine after i re-create the index, except that the record i've just appended is gone. However, when i
>issue the codes to append record, i got the same error again.
>
>This problem occationally pops up, it is hard to track when it occurs. There is one thing interesting that
>if i do not use Begin Tran...Tableupdate...End Tran sequence, the record can be successfully appended to the table.
>
>I just want to know why this happens, how to prevent it and how to recover from it. I've been struggled in this for
>several months and just want to get out of this mess. Thank you very much for your kind attention.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform