QueryEx method
ReplyMsg = QueryEx ( QuestionMsg )
| QuestionMsg |
Message |
A Message object that you have prepared. Should contain
a Question object in the Questions
collection |
| ReplyMsg |
Message |
Response from server if the query succeeded. Includes the original Question
plus any records returned. |
The QueryEx method lets you send your own custom Message
to a DNS server. (The Query method sets up a Message
for you.)
Be sure to check the Error property after
every call to QueryEx. Furthermore, even if Error
indicates success from a network communication standpoint, the returned Message
object may contain an error code from the server in its ResponseCode
property. In general, QueryEx does only the most basic communication
tasks and leaves the error checking and retries to you.
ASP/VBScript example
Dim oConn, oQ, oQMsg, oRMsg
Set oConn =
Server.CreateObject("HexDns.Connection")
Set oQ =
Server.CreateObject("HexDns.Question")
Set oQMsg =
Server.CreateObject("HexDns.Message")
'// Set up Question
oQ.Name = "yahoo.com"
oQ.Type = hexDnsTypeMX
oQ.Class = hexDnsClassIN
'// Set up query Message
oQMsg.Id = 1
oQMsg.Questions.Add oQ
'// Do query
Set oRMsg = oConn.QueryEx(oQMsg)
'// Check for errors
If hexDnsErrSuccess <> oConn.Error Then
'// Print error message
ElseIf hexDnsMsgRcodeSuccess <> _
oRMsg.ResponseCode Then
'// Print error message
Else
'// Do something with records in oRMsg
End If
|