Article ID: 154510
Article Last Modified on 3/14/2005
Field ID Description =============================== Record 1 1 Hello Record 2 2 World
Option Explicit
Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset
On Error GoTo trap:
Set db = OpenDatabase("")
Set rs = db.OpenRecordset("Select * from MyTable")
rs.AddNew
rs.Fields(0).Value = 2
rs.Update
Exit Sub
trap:
MsgBox Errors.Count
MsgBox Err.Number & " " & Err.Description
End Sub
Dim MyError As Error
MsgBox Errors.Count
For Each MyError In DBEngine.Errors
With MyError
MsgBox .Number & " " & .Description
End With
Next MyError
120763 How to Retrieve Info from RAISERROR Function in SQL Server DB
Additional query words: errors Collection kbintluk
Keywords: kbhowto KB154510