Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect to remove database
Message
From
05/01/2011 02:41:54
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01494335
Message ID:
01494739
Views:
36
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform