Re: Recommended Approach

From: Don Grover (dgrover_at_assoft.com.au)
Date: 11/11/05


Date: Fri, 11 Nov 2005 16:49:01 +1100

Dan heres a vbscript that download a zip file from web, and writes to disk.

'vbscript.

sSource = "http://www.assoft.com.au/tames/files/tames30.zip"
sDest = "test.zip"
set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")
oHTTP.open "GET", sSource, False
oHTTP.send
tStart = timer()
set oStream = createobject("adodb.stream")
Const adTypeBinary = 1
Const adSaveCreateNotExist = 1
Const adSaveCreateOverWrite = 2
oStream.type = adTypeBinary
oStream.open
oStream.write oHTTP.responseBody
oStream.savetofile sDest, adSaveCreateOverWrite
set oStream = nothing
tElapsed = timer() - tStart
set oHTTP = nothing
WScript.Echo "Done! " & tElapsed & " seconds..."

"Dan Johnson" <johnson@milehi.com> wrote in message
news:dc1c3$4373c490$d826dfe9$5133@VIAWEST.NET...
> Thanks for your reply Don.
>
> Any suggestions for where I can see how an "xmlhttp post " is done?
>
> Dan
>
> "Don Grover" <dgrover@assoft.com.au> wrote in message
> news:%23CKTgBk5FHA.1140@tk2msftngp13.phx.gbl...
>> Not that I have put too much thought into it but here is a possible
>> solution.
>> Have the vb6 app do a xmlhttp post to your web server and have it do the
>> request for subscription date.
>> Then depending on what is returned you can download an update or not.
>>
>> Don
>>
>>
>> "Dan Johnson" <johnson@milehi.com> wrote in message
>> news:5660$437357ed$d826dfe9$15934@VIAWEST.NET...
>> > Our company has a web site hosted by a third party with a connection to
>> > our
>> > SQL Server. The SQL Server resides locally behind the company's
> firewall.
>> >
>> > We write software and would like to have our app (written primarily in
>> > VB6)
>> > occasionally get small amounts of data from our SQL Server. For
> example,
>> > when the customer/user wants to get the most recent update to our
>> > software,
>> > we would want to retrieve the effective date of the user's subscription
> to
>> > make sure they qualify for the update.
>> >
>> > It is my understanding there are two approaches to doing this. One, we
>> > can
>> > make a direct ADO connection from the user's PC to our SQL Server.
>> > Two,
>> > we
>> > could (using RDS???) use our web sites connection to process the data
>> > request, and return whatever info to the user's PC.
>> >
>> > Both alternatives require opening up a port on our firewall to allow
>> > SQL
>> > access (good, bad, ugly???). I would tend to think that using the
>> > first
>> > alternative is preferable because it seems more efficient (if we're
> going
>> > to
>> > open up the port, may as well streamline the user's connection as much
> as
>> > possible...).
>> >
>> > Can anyone point me in the right direction for analysis here? Would be
>> > greatly appreciated!
>> >
>> > Thanks
>> >
>> > Dan
>> >
>> >
>>
>>
>
>



Relevant Pages

  • Re: get a textfile from website into memo
    ... HTTP Request like: ... 'Begin VBScript ... Dim oHttp ... Set oHttp = CreateObject ...
    (alt.comp.lang.borland-delphi)
  • XMLHTTP download has 404 status
    ... I'm trying to use VBScript to download a zip file from a course ... Dim oHttp, Stream, Start, fso, OldName ... Set oHttp = CreateObject ... Set Stream = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • Re: Using wininet over http to get a get.cgi file
    ... 'and save to sDest using ADO Stream ... set oHTTP = WScript.CreateObject ... set oStream = createobject ... Const adSaveCreateOverWrite = 2 ...
    (microsoft.public.inetsdk.programming.scripting.vbscript)
  • Re: Want to Save Files via the browser - in vb script
    ... Sub DownloadWithXMLHTTP ... 'and save to sDest using ADO Stream ... set oHTTP = WScript.CreateObject ... Const adSaveCreateOverWrite = 2 ...
    (microsoft.public.scripting.vbscript)
  • How to set a timeout on a send method?
    ... I have a vbscript that checks the stats of a web page on a ... server in my web farm and then act on that status. ... dim oHTTP ... set oHTTP = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)