Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connect to remove database
Message
De
05/01/2011 02:41:54
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01494335
Message ID:
01494739
Vues:
37
>Naomi
>
>AERROR returned no error
>
>But data is not updated on website.

Actually, you were very close. A couple of things you need to know:

- SQLexec() won't raise an error. It isn't a Fox error, anyway, it's a remote server error that gets reported back to Fox, so your On Error will not fire.

- the result of SqlExec() is the number of cursors returned (yes you can run several select statements - your command can be a whole script), or 1 if no cursors but still OK, or a -1. If it's a -1, then the errors reported can be retrieved via aError().

So your code would be
 cSQL = "update reembolso (nome = 'test' )  "
rp = SQLEXEC(lnHandle, cSQL)
if rp<0
   = AERROR(aErrorArray)  && Data from most recent error
  c=""
   FOR n = 1 TO 7  && Display all elements of the array
        c=c+transform( aErrorArray(n))+chr(13)
   ENDFOR
   = MESSAGEBOX( c)
endif
Actually, aError() may return multiple rows, if multiple errors were returned, and then it becomes
  numErrors = AERROR(aErrorArray)  && Data from most recent error
  c=""
  for i=1 to numErrors
   FOR n = 1 TO 7  && Display all elements of the array
        c=c+transform( aErrorArray(i, n))+chr(13)
   ENDFOR
  endfor

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform