Solved

VB.Net - VB6 convert DNSClient Code

Posted on 2014-02-14
6
343 Views
Last Modified: 2014-02-28
Good Day Experts!

I have converted a VB6 project to VB 2005 and there was some code conversion I am having trouble with.  

VB6
Dim oDNS
Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"

Converted 2005
Dim oDNS As Object
oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
Dim strFoundIPaddress As Object
'UPGRADE_WARNING: Couldn't resolve default property of object
 oDNS.ServerAddresses = "555.555.55.55"
'UPGRADE_WARNING: Couldn't resolve default property of object oDNS.Separator. oDNS.Separator = ", "            
'UPGRADE_WARNING: Couldn't resolve default property of object
On Error Resume Next
oDNS.Resolve.oDNS.Resolve("Test.com", strFoundIPaddress, "C_IN", "T_A")

I have searched the net for assistance but I didn't find anything.

Do you have any suggestions that may help me out?

Thanks,
jimbo99999
0
Comment
Question by:Jimbo99999
  • 4
  • 2
6 Comments
 
LVL 5

Expert Comment

by:advfinance
ID: 39858906
oDNS.ServerAddresses

Open in new window

will probably be an instance of a class type. Find out what the default property is for that class and change
oDNS.ServerAddresses = "555.555.55.55"

Open in new window

to use that property. So if the default property is "Value", change that line to
oDNS.ServerAddresses.Value = "555.555.55.55"

Open in new window

.

If that works, repeat for the other lines with warnings.

--
Chris
0
 

Author Comment

by:Jimbo99999
ID: 39874068
Thanks for responding Chris.  I am finally able to get back to this project and I will try out your suggestions.

Thanks,
jimbo99999
0
 

Author Comment

by:Jimbo99999
ID: 39882654
Hello Chris:

I look for the reference you mentioned( instance of a class) in the code but did not find it.  

The above code was just at the top of a subroutine in the VB6 version:

Dim oDNS
Set oDNS = CreateObject("Emmanuel.SimpleDNSClient.1")
Dim strFoundIPaddress
oDNS.ServerAddresses = "555.555.55.55"
oDNS.Separator = ", "
On Error Resume Next
oDNS.Resolve "Test.com", strFoundIPaddress, "C_IN", "T_A"
0
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
LVL 5

Accepted Solution

by:
advfinance earned 500 total points
ID: 39885192
I was wrong, I found the source code for the component you're using (http://www.codeguru.com/cpp/i-n/internet/dns/article.php/c6173/Simple-DNS-Resolver-v15.htm from http://www.codeguru.com/cpp/i-n/internet/dns/article.php/c6173/Simple-DNS-Resolver-v15.htm - not sure if it's the same version you're using). "ServerAddresses" is just a string property of the SimpleDNSClient class. Does the code actually run?

--
Chris
0
 

Author Comment

by:Jimbo99999
ID: 39891887
Good Day

The code runs but it I am not getting the IP Address in the strFoundIPaddress variable.  
I guess I am not really understanding why/what the oDNS.Resolve is trying to resolve.  
Why can't they just put the IP Address in there or is it not known...I don't know.

Thanks,
jimbo99999
0
 

Author Closing Comment

by:Jimbo99999
ID: 39895008
Thanks for your help.  It was determinied that I do not need to use the block of code.  However, I appreciate the links you included...they will be a nice addition to my knowledge base.

Thanks,
jimbo99999
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question