what do I have to do to make ado stream work in vbs?
From: gg (gg_at_nomail.nil)
Date: 02/07/05
- Previous message: gg: "Re: Barcode on the page."
- Next in thread: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"
- Reply: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"
- Messages sorted by: [ date ] [ thread ]
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
- Previous message: gg: "Re: Barcode on the page."
- Next in thread: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"
- Reply: Michael Harris \(MVP\): "Re: what do I have to do to make ado stream work in vbs?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|