Solved

Error: Server name or address could not be resolved

Posted on 2007-03-25
16
3,237 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
  • 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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