INET Queries

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laphan

    INET Queries

    Hi All

    Just wanted to know if anybody knows the answer to the following quick
    queries:

    1) The reason I'm using VB's INET control is to download copies of Ms Access
    DBs on a range of web sites so that I have a backup. Found out from my ISP
    that if my DBs go up the spout then it's down to me to restore - gulp!!!

    I've created a little FTP gizmo where I could download web pages OK, but not
    my Access DB files.

    After hours of web trawling, I convinced myself that the reason these files
    wouldn't download is because they are binary and my web pages are just text.
    Went about the task of add a binary file creation routine and found it still
    wouldn't run properly. To cut an already long story short, I had fell foul
    to the short names problem with the INET control. Found out how to correct
    this, but should I be using the binary method for these DBs or is the
    standard string-y download OK??

    The byte size and functionality seems to be OK, but because the main reason
    is so that I have a true backup I just want to make sure.

    2) I'm using chunks of 1024 to get the data, but this seems like I'm
    bottlenecking my 512k connection. My problem is that when I set it to 4096
    (being a good boy and keeping the byte size true) as a test, it seemed to
    make the file bigger probably because the 4096 chunks went over the true
    file size.

    Is this OK to do so (I'm not sure) and if not is there anyway to get the
    size of the file and create some kind of FTP algo to download the right
    amount at the optimum speed?

    Many thanks.

    Rgds

    Laphan


  • Laphan

    #2
    Re: INET Queries

    Many thanks Guys. Valuable info, but could you tell me this:

    1) But are Access DBs binary? I've downloaded these DBs and the file/byte
    sizes are correct and everything seems to work fine in the DB (ie, tables
    and queries).

    Is it the case that the Access DBs are binary and that the INET downloads in
    binary mode by default? If so, why the binary mode example in MSDN?

    Thinking about it, it just can't be binary mode so why are my DBs looking
    OK?

    2) Although a Win2000 Server fault nearly caught me out today, it seems to
    be working fine. Only thing is that I'm downloading about 10 DBs from
    various sites (total size about 4MB at the moment) every day and it just
    seems like a 1024 setting is holding back or thrashing the wotsits off my
    hard drive and ADSL connection. Is this so?

    How do I increase it without going over the actual file size, eg if I bump
    it up to 10240 (10K right?) the file might be 56K and thus I'm adding 4K
    more onto the file everytime I download it.

    3) The XML option looks interesting but:

    a) It's doing it one go download's won't this hog the machine - especially
    with my 400K DBs?

    b) What dependencies are needed to run on a virgin machine?

    Many thanks.

    Rgds

    Laphan


    MN <imthedaddynah@ hotmail.com> wrote in message
    news:adb8f7dd.0 307110501.33379 324@posting.goo gle.com...
    "Laphan" <news@FrozenMol es.co.uk> wrote in message
    news:<bei28h$o5 b$1@sparta.btin ternet.com>...[color=blue]
    > Hi All
    >
    > Just wanted to know if anybody knows the answer to the following quick
    > queries:
    >
    > 1) The reason I'm using VB's INET control is to download copies of Ms[/color]
    Access[color=blue]
    > DBs on a range of web sites so that I have a backup. Found out from my[/color]
    ISP[color=blue]
    > that if my DBs go up the spout then it's down to me to restore - gulp!!!
    >
    > I've created a little FTP gizmo where I could download web pages OK, but[/color]
    not[color=blue]
    > my Access DB files.
    >
    > After hours of web trawling, I convinced myself that the reason these[/color]
    files[color=blue]
    > wouldn't download is because they are binary and my web pages are just[/color]
    text.[color=blue]
    > Went about the task of add a binary file creation routine and found it[/color]
    still[color=blue]
    > wouldn't run properly. To cut an already long story short, I had fell[/color]
    foul[color=blue]
    > to the short names problem with the INET control. Found out how to[/color]
    correct[color=blue]
    > this, but should I be using the binary method for these DBs or is the
    > standard string-y download OK??
    >
    > The byte size and functionality seems to be OK, but because the main[/color]
    reason[color=blue]
    > is so that I have a true backup I just want to make sure.
    >
    > 2) I'm using chunks of 1024 to get the data, but this seems like I'm
    > bottlenecking my 512k connection. My problem is that when I set it to[/color]
    4096[color=blue]
    > (being a good boy and keeping the byte size true) as a test, it seemed to
    > make the file bigger probably because the 4096 chunks went over the true
    > file size.
    >
    > Is this OK to do so (I'm not sure) and if not is there anyway to get the
    > size of the file and create some kind of FTP algo to download the right
    > amount at the optimum speed?
    >
    > Many thanks.
    >
    > Rgds
    >
    > Laphan[/color]

    I've not used INET before but I've achieved the same results with
    Microsoft XML4 (earlier versions would work but I need 4 because I
    have to go through a proxy) and Microsoft ADO 2.5

    Private Sub Command1_Click( )
    Dim lobjXML As MSXML2.ServerXM LHTTP40
    Dim lobjStr As ADODB.Stream

    Set lobjXML = New MSXML2.ServerXM LHTTP40
    Set lobjStr = New ADODB.Stream

    'leave this line out if you're not behind a proxy server
    'lobjXML.setPro xy 2, "INETPROXY: 80"

    'if you're downloading large files it might be a good idea
    'to use the setTimeouts method of the XML object to extend
    'the length of the wait period

    'make a synchronous request for the binary file
    lobjXML.open "GET", "http://www.bbc.co.uk/images/logo.gif", False
    lobjXML.send
    lobjXML.waitFor Response

    'set the stream object to binary
    lobjStr.Type = adTypeBinary
    lobjStr.open

    'write the contents of the downloaded file to the stream object
    lobjStr.Write lobjXML.respons eBody

    'and dump it to a file
    lobjStr.SaveToF ile "c:\test.gi f", adSaveCreateOve rWrite

    MsgBox "Done"

    End Sub




    Comment

    • MN

      #3
      Re: INET Queries

      "Laphan" <news@FrozenMol es.co.uk> wrote in message news:<ben115$bs 0$3@sparta.btin ternet.com>...[color=blue]
      > Many thanks Guys. Valuable info, but could you tell me this:
      >
      > 1) But are Access DBs binary? I've downloaded these DBs and the file/byte
      > sizes are correct and everything seems to work fine in the DB (ie, tables
      > and queries).
      >
      > Is it the case that the Access DBs are binary and that the INET downloads in
      > binary mode by default? If so, why the binary mode example in MSDN?
      >
      > Thinking about it, it just can't be binary mode so why are my DBs looking
      > OK?[/color]

      The Access DB's are binary files. I'm not familiar with INET so I
      can't say one way or another what's going on there, but if your
      databases are working ok after download then everything must be
      peachy.
      [color=blue]
      > 2) Although a Win2000 Server fault nearly caught me out today, it seems to
      > be working fine. Only thing is that I'm downloading about 10 DBs from
      > various sites (total size about 4MB at the moment) every day and it just
      > seems like a 1024 setting is holding back or thrashing the wotsits off my
      > hard drive and ADSL connection. Is this so?[/color]

      A 4MB download over a 512k link should only take about a minute
      assuming you're not downloading anything else at the same time.
      Writing 4MB to the HD should barely register on the performance graph.
      Maybe you're just imagining it :)
      [color=blue]
      > How do I increase it without going over the actual file size, eg if I bump
      > it up to 10240 (10K right?) the file might be 56K and thus I'm adding 4K
      > more onto the file everytime I download it.[/color]

      You shouldn't be able to write more to the file than you've
      downloaded. If you do then I doubt Access will open it, something to
      do with checksums or something.
      [color=blue]
      > 3) The XML option looks interesting but:
      >
      > a) It's doing it one go download's won't this hog the machine - especially
      > with my 400K DBs?[/color]

      Nah. It'll be over before you even notice it. 4Mb is nothing compared
      to most Windows Update downloads.
      [color=blue]
      > b) What dependencies are needed to run on a virgin machine?[/color]

      Microsoft XML Parser, V4 if you're behind a proxy, any other if you're
      not (but might as well get the latest one eh)



      and ADO (2.5 or above) which is part of MDAC (most likely already
      installed)

      [color=blue]
      > Many thanks.
      >
      > Rgds
      >
      > Laphan[/color]

      No problem. My tech knowledge might be lacking a little (checksums,
      INET and the like) but the code is sound (I believe)

      --
      MN

      Comment

      Working...