Solved

Error: Server name or address could not be resolved

Posted on 2007-03-25
16
3,584 Views
Last Modified: 2007-11-27
Hi: Can any one please tell me how to i fixed that error:
Error Type:
msxml3.dll (0x80072EE7)
The server name or address could not be resolved
/Deceased.asp, line 31
-----------------------------------------------------------------------------
Const ForAppend = 8
Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim DBConn,rs,social,vpath,vfile,xLine
Dim WShell
Set WShell = CreateObject("wscript.shell")
vPath = WShell.SpecialFolders("MyDocuments") & "\"
vFile = vPath & "Deceased-Information-"
vFile = vFile & year(now) & month(now) & day(now) & "-"
vFile = vFile & hour(now) & minute(now) & second(now) & ".txt"
Set DBConn = CreateObject("ADODB.Connection")
DBConn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dec1"
sSQL = "select name1,ssn1 from dbtr where status_code=450"
Set rs = DBConn.Execute(sSQL)
Set objFile = objFSO.OpenTextFile(vfile, ForAppend, True)
Do While Not rs.EOF
            objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social)
            response.write(rs.Fields("ssn1"))
            response.write("<br>")      
            rs.moveNext
loop

Function PostURL(sURL, aPostData)
Dim XmlHTTP

Set XmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")

With XmlHTTP
      .Open "POST", sURL, False
      .setRequestHeader "Content-Type", "application/ x-www-form- urlencoded"
      .send aPostData
      If .Status = 200 Then
            PostURL = .responseText
      Else
            PostURL = "Error!"
      End If
End With
Set XmlHTTP = Nothing

End Function
0
Comment
Question by:mustish1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789759
Does that url reside on the same server and protocol as the current page?
0
 

Author Comment

by:mustish1
ID: 18789773
No but the same program works in VB

Thanks.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789781
If you use a URL that doesn't exist, or you are behind a firewall that blocks certain web sites, or the site is behind a firewall that blocks traffic to port 80 / 443, or you are using a proxy server, or the site requires authentication, you will receive this error.

The code may work in Visual Basic on YOUR COMPUTER. But on a third party server this code may not work due to network settings.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mustish1
ID: 18789784
ok but i want to run only on my computer. I am using windows 2000 PRO. Can you please tell me what i do settings in it so that it will run as there is no antivirus or any other thing install on my computer.

Thanks.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789794
Is the webserver running on the same computer you tested with in Visual Basic?
0
 

Author Comment

by:mustish1
ID: 18789795
Yes
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789807
Try adding this line after Set XmlHTTP:

Set XmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
XmlHTTP.setTimeouts 30000, 30000, 0, 0
0
 

Author Comment

by:mustish1
ID: 18789816
This time no errors but the output file is not created into my document folder. It prints just the deceased Social numbers from the SQL
321127371
322142462
351441270

Thanks.


Const ForAppend = 8
Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim DBConn,rs,social,vpath,vfile,xLine
Dim WShell
Set WShell = Server.CreateObject("wscript.shell")
vPath = WShell.SpecialFolders("MyDocuments") & "\"
vFile = vPath & "Deceased-Information-"
vFile = vFile & year(now) & month(now) & day(now) & "-"
vFile = vFile & hour(now) & minute(now) & second(now) & ".html"
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dec1"
sSQL = "select name1,ssn1 from dbtr where status_code=450"
Set rs = DBConn.Execute(sSQL)
Set objFile = objFSO.OpenTextFile(vfile, ForAppend, True)
Do While Not rs.EOF
            objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social)
            response.write(rs.Fields("ssn1"))
            response.write("<br>")      
            rs.moveNext
loop

Function PostURL(sURL, aPostData)
Dim XmlHTTP

Set XmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
XmlHTTP.setTimeouts 30000, 30000, 0, 0

With XmlHTTP
      .Open "POST", sURL, False
      .setRequestHeader "Content-Type", "application/ x-www-form- urlencoded"
      .send aPostData
      If .Status = 200 Then
            PostURL = .responseText
      Else
            PostURL = "Error!"
      End If
End With
Set XmlHTTP = Nothing

End Function
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789862
objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social)

Social isn't defined anywhere? Do you mean this:

objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & rs.Fields("ssn1"))
0
 

Author Comment

by:mustish1
ID: 18789878
Ah yes I am sorry its my fault. But it still not creating any text file in my document folder. Is there any other way when i run the program the output wil be print in the browser instead of creating an HTML file in my document folder.

Thanks.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789883
Do While Not rs.EOF
            response.write(rs.Fields("ssn1"))
            response.write("<hr>")
            response.write(PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social))
            response.write("<hr><br><br><br>")      
            rs.moveNext
loop
0
 

Author Comment

by:mustish1
ID: 18789889
Thanks. This time its open the web site but its not pulling the records in the web site

Const ForAppend = 8
Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
Dim DBConn,rs,social,vpath,vfile,xLine
Dim WShell
Set WShell = Server.CreateObject("wscript.shell")
Set DBConn = Server.CreateObject("ADODB.Connection")
DBConn.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dec1"
sSQL = "select name1,ssn1 from dbtr where status_code=450"
Set rs = DBConn.Execute(sSQL)
Do While Not rs.EOF
   response.write(rs.Fields("ssn1"))
   response.write("<hr>")
   response.write(PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social))
   response.write("<hr><br><br><br>")      
   rs.moveNext

loop

Function PostURL(sURL, aPostData)
Dim XmlHTTP

Set XmlHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP")
XmlHTTP.setTimeouts 30000, 30000, 0, 0

With XmlHTTP
      .Open "POST", sURL, False
      .setRequestHeader "Content-Type", "application/ x-www-form- urlencoded"
      .send aPostData
      If .Status = 200 Then
            PostURL = .responseText
      Else
            PostURL = "Error!"
      End If
End With
Set XmlHTTP = Nothing

End Function
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 18789894
>>This time its open the web site but its not pulling the records in the web site

What exactly do you mean? What is the output?
0
 

Author Comment

by:mustish1
ID: 18789907
Can you please check the output files. One is correct and one is wrong. It print the wrong output file.

http://www.ee-stuff.com/Expert/Upload/viewFilesQuestion.php?qid=22471351

Thanks.
0
 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 500 total points
ID: 18789921
It's doing that because the form element name is ssn and not ssn1.


response.write(PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn=" & social))
0
 

Author Comment

by:mustish1
ID: 18789938
Thanks Brian
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

634 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