Solved

Error: Server name or address could not be resolved

Posted on 2007-03-25
16
3,031 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
 

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Adding items to html ul from on server side. 4 55
Need help editing script 3 65
Microsoft SQL ADO Conn Issue 6 40
Change visitor's REMOTE_ADDR to server's REMOTE_ADDR 2 19
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

18 Experts available now in Live!

Get 1:1 Help Now