Solved

Error: Server name or address could not be resolved

Posted on 2007-03-25
16
2,911 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
Comment Utility
Does that url reside on the same server and protocol as the current page?
0
 

Author Comment

by:mustish1
Comment Utility
No but the same program works in VB

Thanks.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
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
 

Author Comment

by:mustish1
Comment Utility
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
Comment Utility
Is the webserver running on the same computer you tested with in Visual Basic?
0
 

Author Comment

by:mustish1
Comment Utility
Yes
0
 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
Try adding this line after Set XmlHTTP:

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

Author Comment

by:mustish1
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 19

Expert Comment

by:BrianGEFF719
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Brian
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Classic ASP - SQL Server connection problem 5 49
Css expand Div to fit its content (Of other divs) 4 41
JSON error 4 38
asp syntax 3 20
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now