what do I have to do to make ado stream work in vbs?

From: gg (gg_at_nomail.nil)
Date: 02/07/05

  • Next message: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"
    Date: Mon, 7 Feb 2005 12:38:51 -0700
    
    

    the statement
             oStream.saveToFile sTo, 3 ' Create if needed and overwrite if
    necessary
    give me trouble about invalid argument. I verified that sTo has the right
    path and directory. What I don't know is hoe to make the 2nd argument to
    conform what the stream saveToFile expect the constant create or write over
    mode.

    Please help.

    the context of the problematic statements is as follows

          Dim oDnLod
          set oDnLod = CreateObject("Msxml2.XmlHttp.3.0")
          oDnLod.open "GET", strUrl, false
          oDnLod.send()

          If oDnLod.status = 200 Then

             ' first delete all similar files in the same year with same
    platform
             delOldFile()

             ' the real download and save

             Dim oStream
             set oStream = CreateObject("Adodb.Stream")
             oStream.type = 1 ' Binary
             oStream.open()
             oStream.write(oDnLod.responseBody)
    ' Dim sTo, imode
              iMOde = 1 + 2
             sTo = strVirusDef & "\temp\" & strNameTemp

             msgbox sto &vbcrlf
             oStream.saveToFile sTo, 3 ' Create if needed and overwrite if
    necessary
             oStream.close()
             set oStream = nothing
             wscript.echo "dnlod cpt for " & StrNameTemp &vbcrlf &vbcrlf &
    "locan: " &strVirusDef & "\temp\" & strNameTemp &vbcrlf &"istart="&istart
          else
             Wscript.echo "while downloading " &strNameTemp & vbcrlf &
    oDnLod.statusText &vbtab &"status=" &oDnLod.status &vbcrlf &vbcrlf &vbcrlf
    &strUrl 'Needs improving
          End If


  • Next message: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"

    Relevant Pages

    • Re: Dam my local ARGOS sucks
      ... Please replace invalid and invalid with gmx and net to reply. ... Trouble started when they tried selling extended warranty products ...
      (uk.tech.digital-tv)
    • Re: Problems marshaling DateTime parameters
      ... > I broke this code (generated by importing a web reference) into three ... > statements so I could see which part gave it trouble. ... This statement produces the exception "Invalid ...
      (microsoft.public.dotnet.framework.webservices)
    • 2k3 error 550 "Invalid Domain" is my domain
      ... Our Ex 2003 server has been up and running for almost a year and ... occasionally a user will get a Undeliverable report which says 550 Invalid ... we've never had trouble with in the past. ...
      (microsoft.public.exchange.admin)
    • Re: bcm43xx-fwcutter
      ... I managed to get the interface up with the links you've kindy provided. ... Now I have a trouble with the communication.I'm trying this on ubuntu 6.06. ... Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 ...
      (Ubuntu)
    • Re: EE?Pro / EEPro / EE Pro: for HP 49
      ... When I say ASM 'EEPATCH' STO I get a box, "Error, Invalid File." ... Maybe I have a screwed up ROM version? ...
      (comp.sys.hp48)

    Loading