ErrorCode Property

Description:

The ErrorCode property returns the error code if an error occurred during the last method call or property read/write. If no error occurred then it returns the value 0. 

   

Usage lngErrorNumber = ObjectName.ErrorCode
Value Type Long
Access Mode Read Only
Valid Values
  • 0 - No Error
  • Greater than 0 - Error Code of the last error
Remarks
  • ErrorCode property is an extended version of IsError property.
  • To get string format (error description), use ErrorDescription property.

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.Port = "COM2"
objSMS.BaudRate = 57600
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
If objSMS.Connect Then
     MsgBox "Connected Successfully!"
     objSMS.Disconnect
Else
     MsgBox "Error " & CStr(objSMS.ErrorCode) & _
            ": " & objSMS.ErrorDescription
End If
Set objSMS = Nothing

   

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved