?
Solved

Type mismatch

Posted on 2007-03-23
6
Medium Priority
?
629 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 2000 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
Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

 

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

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!

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
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 about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

765 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