MartyConnelly
martyconnelly at shaw.ca
Tue Nov 18 13:03:58 CST 2003
Here is a snippet of code to look at Ado expanded errors 'where cnn is ADODB Connection Object cnn.Close Set cnn = Nothing Exit Function ' ADO Error/Exception Handler AdoError: Dim ErrNumber As Long Dim ErrSource As String Dim ErrDescription As String ErrNumber = Err.Number ErrSource = Err.Source ErrDescription = Err.Description AdoErrorExpanded cnn cnn.Close Set cnn = Nothing 'where Cnn is Connection Object End Function Sub AdoErrorExpanded(Conn1 As ADODB.Connection) ' ADO Error/Exception Handler Expanded Dim Errs1 As ADODB.Errors Dim errLoop As ADODB.Error Dim i As Long Dim strMsgErr As String i = 1 On Error Resume Next ' For any error condition, show results in debug ' Enumerate Errors collection and display properties ' of each Error object. Set Errs1 = Conn1.Errors For Each errLoop In Errs1 With errLoop Debug.Print " Error #" & i & ":" Debug.Print " ADO Error #" & .Number Debug.Print " Description " & .Description Debug.Print " Source " & .Source Debug.Print " HelpFile " & .HelpFile Debug.Print " HelpContext " & .HelpContext Debug.Print " NativeError " & .NativeError Debug.Print " SQLState " & .SQLState strMsgErr = " Error #" & i & ":" strMsgErr = strMsgErr & vbCrLf & " ADO Error #" & .Number strMsgErr = strMsgErr & vbCrLf & " Description " & .Description strMsgErr = strMsgErr & vbCrLf & " Source " & .Source strMsgErr = strMsgErr & vbCrLf & " HelpFile " & .HelpFile strMsgErr = strMsgErr & vbCrLf & " HelpContext " & .HelpContext strMsgErr = strMsgErr & vbCrLf & " NativeError " & .NativeError strMsgErr = strMsgErr & vbCrLf & " SQLState " & .SQLState MsgBox strMsgErr i = i + 1 End With Next With Conn1 Debug.Print "ADO Version: " & .Version & vbCrLf & _ "DBMS Name: " & .Properties("DBMS Name") & vbCrLf & _ "DBMS Version: " & .Properties("DBMS Version") & vbCrLf & _ "OLE DB Version: " & .Properties("OLE DB Version") & vbCrLf & _ "Provider Name: " & .Properties("Provider Name") & vbCrLf & _ "Provider Version: " & .Properties("Provider Version") & vbCrLf Debug.Print "ADO Version: " & .Version & vbCrLf & _ "DBMS Name: " & .Properties("DBMS Name") & vbCrLf & _ "DBMS Version: " & .Properties("DBMS Version") & vbCrLf & _ "OLE DB Version: " & .Properties("OLE DB Version") & vbCrLf & _ "Provider Name: " & .Properties("Provider Name") & vbCrLf & _ "Provider Version: " & .Properties("Provider Version") & vbCrLf & _ "Driver Name: " & .Properties("Driver Name") & vbCrLf & _ "Driver Version: " & .Properties("Driver Version") & vbCrLf & _ "Driver ODBC Version: " & .Properties("Driver ODBC Version") End With End Sub Charlotte Foust wrote: >You need to error trap the ADO errors specifically and loop through the >connection's errors collection to see what's going on. A lot of ADO >errors are "silent" in Access. > >Charlotte Foust > >-----Original Message----- >From: Liam Meadows [mailto:liam at energyexhausts.co.uk] >Sent: Tuesday, November 18, 2003 7:07 AM >To: Access Developers discussion and problem solving >Subject: [AccessD] Problems with Access ADP and multiple-step OLE DB > > >I am trying to create a form Based on an SQL table but when I try and >exit from the form sometimes I get an error saying "'Multiple-step OLE >DB operation generated errors. Check each OLE DB status value, if >available. No work was done.". I have tried MSKB and changed the Persist >Security Info to False in connection manager (File -> Connections -> >All) and checked the registry setting as described in the MS KB but it >still happens. Has anyone any idea how to resolve this ? > >Liam >_______________________________________________ >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com >_______________________________________________ >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com > > > -- Marty Connelly Victoria, B.C. Canada