Sub Testing()
On Error GoTo errhandle
Call openConnection
Objconn.Execute "sptest"
Call closeConnection
errhandle:
If Err.Number = -2147217900 Then
MsgBox "This value already exists in the database and cannot be added."
Else
MsgBox "An unexpected error has occurred please forward the following information to tech support" & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error description: " & Err.Description
End If
End Sub