Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting the last SQL error?
Message
De
21/09/2011 11:56:42
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
21/09/2011 09:32:00
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
Database:
Visual FoxPro
Divers
Thread ID:
01524131
Message ID:
01524166
Vues:
42
Just a sidenote... aError() returns the number of rows. Sometimes a SQL statement will return multiple errors, so if you want to see them all, code would look like this:
Try
	lnReturn = DoSelect(lcSQL)
Catch
	nErrors=AError(laErrors)
    for i=1 to nErrors
	If laErrors(i, 1) = 1832
		This.SetError(This.Class + ' SQL ERROR:' + laErrors(i, 2), laErrors(i, 1))
	Endif
   endfor
	lnReturn = -1
Endtry
Not that it would help you much, though. Very often the 2nd row is only a repeat of the first row, but sometimes there's valuable info there.

Of course, if you can't use your own routine, or find a way to subclass the original code, then maybe your only way out is to try to repeat the offending statement and check the error array on your own.

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