views:

60

answers:

1

Is there a way to get the detailed error-messages PostgreSQL shows when running a query from command-line or a client like PG-Admin when using the ODBC-Interface-Driver?

The Err-object in Access just tells you that something went wrong but is not very helpful - I have to run the same query again in PG-Admin to see where the problem is.

A: 

Silly me! Just have to iterate through the Errors-object...

Dim errX As DAO.Error
Dim strError As String

For Each errX In DAO.Errors
    strError = strError & "# >> " & errX.number & " | txt >> " & _
                errX.DESCRIPTION & Chr(10) & Chr(10)
Next errX
Florian
It would be better to use either vbNewLine instead of chr(10); or at least vbLf if it must be a linefeed character.
CodeSlave
In VBA code within Access, the usual global contant is vbCrLf, though that returns the same thing as vbNewLine. I think it's helpful to remember that it's two characters and in that particular order, which is why I use vbCrLf.
David-W-Fenton