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 <im***********@hotmail.com> wrote in message
news:ad**************************@posting.google.c om...
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message
news:<be**********@sparta.btinternet.com>...
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
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.ServerXMLHTTP40
Dim lobjStr As ADODB.Stream
Set lobjXML = New MSXML2.ServerXMLHTTP40
Set lobjStr = New ADODB.Stream
'leave this line out if you're not behind a proxy server
'lobjXML.setProxy 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.waitForResponse
'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.responseBody
'and dump it to a file
lobjStr.SaveToFile "c:\test.gif", adSaveCreateOverWrite
MsgBox "Done"
End Sub