I'm executing a query using ADO:
Dim connLocal As ADODB.Connection
Set connLocal = CurrentProject.Connection
strSQL = "INSERT INTO dbo_tbl_ErrorLog SELECT tbl_ErrorLog.* FROM tbl_ErrorLog;"
On Error GoTo ErrorSQL
connLocal.Execute strSQL
.....
ErrorSQL:
lErrNo = Err.Number
strErrDesc = Err.Description
If InStr(1, strErrDesc, "ODBC") Then
Dim i As Long
Dim strErr As String
For i = 0 To connLocal.Errors.Count - 1
strErrDesc = strErrDesc & vbCrLf & connRemote.Errors(i).Number & " - " & connLocal.Errors(i).Description
Next i
End If
.....
In the query the table dbo_tbl_ErrorLog
is linked MS SQL table, tbl_ErrorLog
- linked MS Access table.
In case of SQL query error I receive an error:
-2147467259 - ODBC--call failed.
And I when I'm trying to get error details, the collection connLocal.Errors
contains just one item "ODBC--call failed". Is it possible to retrieve full error details in such case of mixed query?