Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of Index problem - can't see how it could happen
Message
De
13/08/2002 12:43:57
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Uniqueness of Index problem - can't see how it could happen
Divers
Thread ID:
00689229
Message ID:
00689229
Vues:
66
On the code below, which ran against 600 rows in the curresult table, for one entry, I received the error: Uniqueness of index xitemno will be violated
I can't see how this error could happen in this context. Maybe I am overlooking something simple, or there is some simple logic error (I was up late last night!), but I can't see how it could happen unless the seek failed erroneously. This code was running on my test machine, in a standalone environment. I can see how it would happen in a multiuser environment, but not here.
(See notes in code below)

Thanks in advance for any suggestions.
Case alltrim(curResult.tablename)=='icitem'
	Select 0
	Use (curResult.tablename)

	** find the original item
	If seek(lcolditemno,'icitem', 'xitemno')

		lnrecpointer=recno('icitem')
		** see if the new item exists already
		If not seek(lcnewitemno,'icitem', 'xitemno')
			** if the new item doesn't exist already,
			*go back to the original, and
			**change the old to the new
			Goto lnrecpointer in icitem
                       
                        *** got error message here on this replace. I have 
                        *** looked at this code a million times, and
                        ** can not figure out how it could fail
                        ** unless the seek failed when it really should not
                        **have
			Replace icitem.citemno with lcnewitemno in icitem
		Else
			Wait wind 'Item ' + lcnewitemno +  ;
                        ' already exists    in icitem ' + chr(13) + ;
				'Item ' + lcolditemno + ' will be ' + ;
                         ' replaced  with ' + lcnewitemno + ;
				' in transaction detail lines, and ' +   
                                 lcolditemno + ;
				' will be deleted from   the icitem
                                 table '   nowait
			Goto lnrecpointer in icitem
			Delete in icitem
		Endif
	Else
		Wait wind 'Error: original item not found in change list - 
                skipping ' nowait
	Endif
	Use in icitem
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform