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.