Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Numeric Overflow - Scatter and Gather
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00691273
Message ID:
00691682
Vues:
24
>Thanks for the answers
>I guess I forgot to mention though that there are no actual overflows or fields with larger contents. There does not appear to be any reason. I am ceating a cursor using AFIELDS() and simply transferring the data from the cursor to the parent table using SCATTER AND GATHER.
>One of the problems seemed to be the positioning of the memo field, but I fixed that by moving the memo field to the end.
>I wondered whether it was something to do with compatibility between FPW26 tables and VFP6 tables and faster pentiums affecting the array.
>Cheers
>John

I don't recall having such problems... Still you can try to isolate the problem by gathering one field in a time. Did you check each field value in Debugger?

Just in case, may be this code will help you to avoid this problem whatsoever:
function CurErrHandler
lparameter tnErrorNum
if not 'vfpevent.fll' $ lower(set('library'))
	set library to vfpEvent.fll additive
endif
if m.tnErrorNum = 39 && Numeric overflow
	local lnFields, lnI, lcAlias, lnRecord, lnResult
	lcAlias = alias()
	lnFields = afields(laFields,m.lcAlias) && assuming the table is opened
	lnRecord = recno(m.lcAlias)
	for lnI=1 to m.lnFields
		if inlist(laFields[m.lnI,2],'N','I','B','Y','F') and ;
				"*" $ transform(evaluate(m.lcAlias+"."+laFields[m.lnI,1])) && This is a field, which gave an error
			lnResult =  EventMBox('Field '+ laFields[m.lnI,1]+" would be blanked because of numeric overflow "+ ;
				chr(13)+"on the record "+transform(m.lnRecord)+" in file "+dbf(m.lcAlias)+ ;
				chr(13)+"Do you want to continue the appending process?", ;
				MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON1, ;
				"Error is encountered!", ;
				"&Proceed", ;
				"&Stop", "")
			blank field (laFields[m.lnI,1])
			pnNumberOfProblems = m.pnNumberOfProblems + 1 && Increment number of problems

			if m.lnResult = IDNO && Stop 
				plHalt = .t. && Stop the process
			endif
		endif
	next
	return
else
	error m.tnErrorNum && produce an error and handle it by normal error Handler
endif
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform