No trabajo con ADO si no con ODBC, otra cosa message(), no te devuelve el mensaje de error ocurrido en estos casos, deberias usar así
Function errordata
Parameter CDATO As String, LSHOW As LOGICAL
If Type("cDato")="L"
CDATO = ""
Endif
Aerror(ERRORARRAY)
If ERRORARRAY(1, 5)=55 .Or. ERRORARRAY(1, 5)=0
* Do Form reconectarsql
Else
If LSHOW
= Messagebox(ERRORARRAY(2)+Chr(13)+CDATO, 16, "Acerca del Registro", 100)
Else
= Messagebox(ERRORARRAY(2)+Chr(13)+CDATO, 16, "Acerca del Registro")
Endif
Endif
Return (.T.)
Endfunc
**
Aerror() te devuelve un array con el mensaje de error ocurrido recientemente con OLE u ODBC.