Type | Description | |||
Long | A long expression that indicates the code of the last error. |
If sending the query to a DNS server fails, or the DNS server fails to reply with an answer, the LastError and LastErrorCode properties indicates the error that occurs. The LastError property gets the description of the last error. Use the LastError or LastErrorCode property to get the last error, if the DNS answer is empty.
For instance, the following sample generates an error, and so the DNS answer is empty:
Dim n As New LookupNS Debug.Print n.Query("micro^soft.com").Address MsgBox n.LastError
The sample generates the error: "The host doesn't not exist. ". In this case, the Address property retrieves an empty string.