Displaying Teradata Database Errors in VB6 using ADO
I'm building an application using VB6 as front-end and Teradata as backend. The problem is that i'm not able to get teradata errors in VB6 using ADO.
For eg. if executing a query referencing an non-existing table in Teradata, i get the following errors using ADO error object.
Error Number : 0 Description : ODBC driver does not support the requested properties Source : Microsoft OLEDB provider for ODBC drivers
rather that getting the teradata error,
Error number : 3807 Description : Table/view/trigger/procedure database.tablename does not exist.
Below mentioned is my code to return the error message :
Dim objErr As ADODB.Errors Dim errLoop As ADODB.Error Dim strTmp As String Set objErr = Conn.Errors For Each errLoop In objErr I = 1 With errLoop strTmp = strTmp & vbCrLf & "Sequence # " & I & ":" strTmp = strTmp & vbCrLf & " Error # : " & .NativeError strTmp = strTmp & vbCrLf & " Description : " & .Description strTmp = strTmp & vbCrLf & " Source : " & .Source I = I + 1 End With Next msgbox strTmp