Solved

Type mismatch

Posted on 2007-03-23
6
624 Views
Last Modified: 2008-01-09
Hi: Can any one please tell me how to i fix that problem on line:
            objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn1=" & social)
Thanks.
Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'PostURL'
/deceased.asp, line 17

Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
---------------------------------------
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
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
  • 3
  • 2
6 Comments
 
LVL 25

Expert Comment

by:kevp75
ID: 18783956
the error lies in the PostURL function/sub.  If you post that, we may be able to help...
0
 

Author Comment

by:mustish1
ID: 18784026
Error Type:
msxml3.dll (0x800C0005)
The system cannot locate the resource specified.
/Deceased.asp, line 29


Function PostURL(sURL, aPostData)
   sURL = CStr(sURL)
   Dim oXml
   Set oXml = CreateObject("Microsoft.XMLHTTP")
   oXml.Open "POST", sURL, False
   oXml.setRequestHeader "Content-Type", "application/ x-www-form- urlencoded"
   oXml.Send aPostData
   PostURL = oXml.responseText
   Set oXml = Nothing
End Function
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 18784091
Try it this way:

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 = "Houston, we have a problem!"
      End If
End If
Set XmlHTTP = Nothing

End Function
0
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 

Author Comment

by:mustish1
ID: 18784097
Error Type:
msxml3.dll (0x80072EE7)
The server name or address could not be resolved
/deceased.asp, line 29


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 = "Houston, we have a problem!"
      End If
End with
Set XmlHTTP = Nothing

End Function
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 18784142
Sounds like you cannot POST to that server...
0
 

Author Comment

by:mustish1
ID: 18784184
This is a actual program in VB6, i just check and it still pulling information from that server. But in this program i used a text file store in ssnFile = "C:\ssn.txt" where i save like 20 social numbers. Since i need that program in ASP thats why i cant save a text file thru browser on every computer therefore i store the social numbers in a table name dbtr of field ssn1

Thanks.

Dim social As String, WShell As Object, vPath As String, vFile
Set WShell = CreateObject("wscript.shell")
vPath = WShell.SpecialFolders("MyDocuments") & "\"
vFile = vPath & "Deceased-Information-" & Format$(Now, "yyyymmdd-hhmmss") & ".html"

Dim ssnFile As String, xLine
ssnFile = "C:\ssn.txt"
Open ssnFile For Input As #2
Do While Not EOF(2)
Line Input #2, xLine
social = Trim(xLine)
Open vFile For Append As #1
Print #1, PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn=" & social)
Close #1

Loop
Close #2
Set WShell = Nothing
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa‚Ķ
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to dynamically set the form action using jQuery.

717 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