Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making a DNS query in VB?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to write a VB program which can query a DNS, but can't find any info or examples on the internet. Has anyone done this or knows how to do it and can help me out?

I have found a website which gives an online VBscript demo of a DNS query program at: You have to pay to download the full source code, and I need it in VB, not VBscript, so its not that useful but is a perfect example of what I want to be able to do in my program.

Could it be done using the Winsock control, or should I use something else? Any help would be greatly appreciated!
 
Go to Project, References..., and select "Microsoft ActiveX Data Objects" (one of them).

Use this partial code:
Code:
Dim cnDSN As New ADODB.Connection
Dim rsDSNQuery As ADODB.Recordset
With cnDSN
  .ConnectionString = "DSN=myDSNname;User ID=myUID;Password=myPWD"
  .Open
End With

Set rsDSNQuery = cnDSN.Execute("SELECT * FROM table1")

Do While Not rsDSNQuery.EOF
  Debug.Print rsDSNQuery![field]
  rsDSNQuery.MoveNext
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top