Data is not pulling from the site

Discussion in 'ASP General' started by colleen1980@gmail.com, Mar 24, 2007.

  1. Guest

    Hi: When i run the same code with minor changes in VB it works fine
    but when i run in ASP it runs but it not pulling any information from
    the web site. Needs help

    Thanks,
    Anna.

    ASP CODE

    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) & ".html"
    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
    social = rs.Fields("ssn1")
    'objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/
    ssdi.cgi", 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


    VB PROGRAM
    Private Sub deceasedProcess()
    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

    End Sub

    ssn.txt
    --------
    321127371
    322142462
    351441270
    , Mar 24, 2007
    #1
    1. Advertising

  2. --
    Dim Alan as ThatsIT.net.au.Staffmember
    Alan.signature = "Thank You"
    Response.Write Alan.signature.toString()
    __________________________________________

    <> wrote in message
    news:...
    > Hi: When i run the same code with minor changes in VB it works fine
    > but when i run in ASP it runs but it not pulling any information from
    > the web site. Needs help
    >
    > Thanks,
    > Anna.
    >
    > ASP CODE
    >
    > Const ForAppend = 8
    > Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")


    try Server.CreateObject("Scripting.FileSystemObject")
    not
    CreateObject("Scripting.FileSystemObject")




    > Dim DBConn,rs,social,vpath,vfile,xLine
    > Dim WShell
    > Set WShell = CreateObject("wscript.shell")
    > vPath = WShell.SpecialFolders("MyDocuments") & "\"


    you are assuminb that the web server has its own mydocuments folder.

    Are you trying to obtain my documents on the server or the client?

    if its the client then you need to run the script client side



    > vFile = vPath & "Deceased-Information-"
    > vFile = vFile & year(now) & month(now) & day(now) & "-"
    > vFile = vFile & hour(now) & minute(now) & second(now) & ".html"
    > Set DBConn = CreateObject("ADODB.Connection")


    Server.CreateObject

    script between the <% %> signs is asp server script, it can contact the
    resources on the server where it is hosted.

    Script inside script tags like this <script></script> can contact resources
    on the clients computer.





    > 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
    > social = rs.Fields("ssn1")
    > 'objFile.WriteLine PostURL("http://ssdi.rootsweb.com/cgi-bin/
    > ssdi.cgi", 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
    >
    >
    > VB PROGRAM
    > Private Sub deceasedProcess()
    > 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
    >
    > End Sub
    >
    > ssn.txt
    > --------
    > 321127371
    > 322142462
    > 351441270
    >
    ThatsIT.net.au, Mar 26, 2007
    #2
    1. Advertising

  3. ThatsIT.net.au wrote:
    >> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")

    >
    > try Server.CreateObject("Scripting.FileSystemObject")
    > not
    > CreateObject("Scripting.FileSystemObject")
    >

    Why? That's neither relevant nor necessary.

    >> Dim DBConn,rs,social,vpath,vfile,xLine
    >> Dim WShell
    >> Set WShell = CreateObject("wscript.shell")
    >> vPath = WShell.SpecialFolders("MyDocuments") & "\"

    >
    > you are assuminb that the web server has its own mydocuments folder.
    >
    > Are you trying to obtain my documents on the server or the client?
    >
    > if its the client then you need to run the script client side
    >

    True

    >> Set DBConn = CreateObject("ADODB.Connection")

    >
    > Server.CreateObject


    Again. Neither relevant nor necessary

    >
    > script between the <% %> signs is asp server script, it can contact
    > the resources on the server where it is hosted.
    >
    > Script inside script tags like this <script></script> can contact
    > resources on the clients computer.
    >


    Maybe. If the page is an hta page, or the website is in the Trusted security
    zone, then what you are saying is correct.


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows [MVP], Mar 26, 2007
    #3
  4. --
    Dim Alan as ThatsIT.net.au.Staffmember
    Alan.signature = "Thank You"
    Response.Write Alan.signature.toString()
    __________________________________________

    "Bob Barrows [MVP]" <> wrote in message
    news:...
    > ThatsIT.net.au wrote:
    >>> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")

    >>
    >> try Server.CreateObject("Scripting.FileSystemObject")
    >> not
    >> CreateObject("Scripting.FileSystemObject")
    >>

    > Why? That's neither relevant nor necessary.



    You are probably right, but I know there are some objects you must use it
    on, also if you are using transactions and if you want a event log entry on
    error. Rather than test what ojects need it, i always use it


    >
    >>> Dim DBConn,rs,social,vpath,vfile,xLine
    >>> Dim WShell
    >>> Set WShell = CreateObject("wscript.shell")
    >>> vPath = WShell.SpecialFolders("MyDocuments") & "\"

    >>
    >> you are assuminb that the web server has its own mydocuments folder.
    >>
    >> Are you trying to obtain my documents on the server or the client?
    >>
    >> if its the client then you need to run the script client side
    >>

    > True
    >
    >>> Set DBConn = CreateObject("ADODB.Connection")

    >>
    >> Server.CreateObject

    >
    > Again. Neither relevant nor necessary
    >
    >>
    >> script between the <% %> signs is asp server script, it can contact
    >> the resources on the server where it is hosted.
    >>
    >> Script inside script tags like this <script></script> can contact
    >> resources on the clients computer.
    >>

    >
    > Maybe. If the page is an hta page, or the website is in the Trusted
    > security zone, then what you are saying is correct.


    Agreed, but I think that is just what colleen is trying to do, seeing the
    the vb app she showed seems to access only the client


    >
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    ThatsIT.net.au, Mar 27, 2007
    #4
  5. "ThatsIT.net.au" <me@thatsit> wrote in message
    news:...
    >
    >
    > --
    > Dim Alan as ThatsIT.net.au.Staffmember
    > Alan.signature = "Thank You"
    > Response.Write Alan.signature.toString()
    > __________________________________________
    >
    > "Bob Barrows [MVP]" <> wrote in message
    > news:...
    > > ThatsIT.net.au wrote:
    > >>> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
    > >>
    > >> try Server.CreateObject("Scripting.FileSystemObject")
    > >> not
    > >> CreateObject("Scripting.FileSystemObject")
    > >>

    > > Why? That's neither relevant nor necessary.

    >
    >
    > You are probably right, but I know there are some objects you must use it
    > on,


    Oh that's interesting. Which ones?
    Anthony Jones, Mar 27, 2007
    #5
  6. --
    Dim Alan as ThatsIT.net.au.Staffmember
    Alan.signature = "Thank You"
    Response.Write Alan.signature.toString()
    __________________________________________

    "Anthony Jones" <> wrote in message
    news:...
    >
    > "ThatsIT.net.au" <me@thatsit> wrote in message
    > news:...
    >>
    >>
    >> --
    >> Dim Alan as ThatsIT.net.au.Staffmember
    >> Alan.signature = "Thank You"
    >> Response.Write Alan.signature.toString()
    >> __________________________________________
    >>
    >> "Bob Barrows [MVP]" <> wrote in message
    >> news:...
    >> > ThatsIT.net.au wrote:
    >> >>> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
    >> >>
    >> >> try Server.CreateObject("Scripting.FileSystemObject")
    >> >> not
    >> >> CreateObject("Scripting.FileSystemObject")
    >> >>
    >> > Why? That's neither relevant nor necessary.

    >>
    >>
    >> You are probably right, but I know there are some objects you must use it
    >> on,

    >
    > Oh that's interesting. Which ones?
    >


    I don't remember, that why I always use it.
    wait I have found the article where I read it
    http://classicasp.aspfaq.com/components/should-i-use-createobject-or-server-createobject.html

    also it points out if you are using JavaScript you must use
    server.createobject
    I don't use JavaScript and I don't use any third party objects I can think
    of either.

    like I said I use it just in case, although the article also points out a
    overhead, I have never found it to be a problem.
    ThatsIT.net.au, Mar 30, 2007
    #6
  7. "ThatsIT.net.au" <me@thatsit> wrote in message
    news:%23q%...
    >
    >
    > --
    > Dim Alan as ThatsIT.net.au.Staffmember
    > Alan.signature = "Thank You"
    > Response.Write Alan.signature.toString()
    > __________________________________________
    >
    > "Anthony Jones" <> wrote in message
    > news:...
    > >
    > > "ThatsIT.net.au" <me@thatsit> wrote in message
    > > news:...
    > >>
    > >>
    > >> --
    > >> Dim Alan as ThatsIT.net.au.Staffmember
    > >> Alan.signature = "Thank You"
    > >> Response.Write Alan.signature.toString()
    > >> __________________________________________
    > >>
    > >> "Bob Barrows [MVP]" <> wrote in message
    > >> news:...
    > >> > ThatsIT.net.au wrote:
    > >> >>> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
    > >> >>
    > >> >> try Server.CreateObject("Scripting.FileSystemObject")
    > >> >> not
    > >> >> CreateObject("Scripting.FileSystemObject")
    > >> >>
    > >> > Why? That's neither relevant nor necessary.
    > >>
    > >>
    > >> You are probably right, but I know there are some objects you must use

    it
    > >> on,

    > >
    > > Oh that's interesting. Which ones?
    > >

    >
    > I don't remember, that why I always use it.
    > wait I have found the article where I read it
    >

    http://classicasp.aspfaq.com/components/should-i-use-createobject-or-server-createobject.html
    >
    > also it points out if you are using JavaScript you must use
    > server.createobject
    > I don't use JavaScript and I don't use any third party objects I can think
    > of either.
    >
    > like I said I use it just in case, although the article also points out a
    > overhead, I have never found it to be a problem.
    >



    That's very interesting. I had thought that as of IIS5 Server.CreateObject
    and CreateObject were functionally the same.

    With JScript you can't use CreateObject because it doesn't exist. It's
    equivalent 'new ActiveXObject()' will work but with the same limitations as
    VBscripts CreateObject does.
    Anthony Jones, Mar 30, 2007
    #7
  8. "Anthony Jones" <> wrote in message
    news:%...
    >
    > "ThatsIT.net.au" <me@thatsit> wrote in message
    > news:%23q%...
    >>
    >>
    >> --
    >> Dim Alan as ThatsIT.net.au.Staffmember
    >> Alan.signature = "Thank You"
    >> Response.Write Alan.signature.toString()
    >> __________________________________________
    >>
    >> "Anthony Jones" <> wrote in message
    >> news:...
    >> >
    >> > "ThatsIT.net.au" <me@thatsit> wrote in message
    >> > news:...
    >> >>
    >> >>
    >> >> --
    >> >> Dim Alan as ThatsIT.net.au.Staffmember
    >> >> Alan.signature = "Thank You"
    >> >> Response.Write Alan.signature.toString()
    >> >> __________________________________________
    >> >>
    >> >> "Bob Barrows [MVP]" <> wrote in message
    >> >> news:...
    >> >> > ThatsIT.net.au wrote:
    >> >> >>> Dim objFSO: Set objFSO=CreateObject("Scripting.FileSystemObject")
    >> >> >>
    >> >> >> try Server.CreateObject("Scripting.FileSystemObject")
    >> >> >> not
    >> >> >> CreateObject("Scripting.FileSystemObject")
    >> >> >>
    >> >> > Why? That's neither relevant nor necessary.
    >> >>
    >> >>
    >> >> You are probably right, but I know there are some objects you must use

    > it
    >> >> on,
    >> >
    >> > Oh that's interesting. Which ones?
    >> >

    >>
    >> I don't remember, that why I always use it.
    >> wait I have found the article where I read it
    >>

    > http://classicasp.aspfaq.com/components/should-i-use-createobject-or-server-createobject.html
    >>
    >> also it points out if you are using JavaScript you must use
    >> server.createobject
    >> I don't use JavaScript and I don't use any third party objects I can
    >> think
    >> of either.
    >>
    >> like I said I use it just in case, although the article also points out a
    >> overhead, I have never found it to be a problem.
    >>

    >
    >
    > That's very interesting. I had thought that as of IIS5
    > Server.CreateObject
    > and CreateObject were functionally the same.
    >
    > With JScript you can't use CreateObject because it doesn't exist. It's
    > equivalent 'new ActiveXObject()' will work but with the same limitations
    > as
    > VBscripts CreateObject does.
    >


    Yes of cause, silly me.
    ThatsIT.net.au, Mar 31, 2007
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?d2FzaG9ldGVjaA==?=

    Pulling data from an Excel spreadsheet into either XML or Dataset

    =?Utf-8?B?d2FzaG9ldGVjaA==?=, Sep 21, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    5,798
    vsurana
    Jul 7, 2008
  2. Guest
    Replies:
    4
    Views:
    2,266
    Steven Cheng[MSFT]
    Feb 6, 2006
  3. Replies:
    3
    Views:
    486
    Wibble
    May 28, 2005
  4. Replies:
    4
    Views:
    321
    Tim Williams
    Nov 28, 2007
  5. Mudcat
    Replies:
    2
    Views:
    963
    Mudcat
    Dec 14, 2008
Loading...

Share This Page