473,385 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Jul 17 '05 #1
2 6033
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


Jul 17 '05 #2
MN
"Laphan" <ne**@FrozenMoles.co.uk> wrote in message news:<be**********@sparta.btinternet.com>...
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?
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.
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?
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 :)
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.
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.
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?
Nah. It'll be over before you even notice it. 4Mb is nothing compared
to most Windows Update downloads.
b) What dependencies are needed to run on a virgin machine?
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)

http://msdn.microsoft.com/library/de...xmlgeneral.asp

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

Many thanks.

Rgds

Laphan


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

--
MN
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Laphan | last post by:
I know this is a crosspost, but I need to know which is the best one for posting INET FTP queries, so that I'm not cross-posting in future. Now that I've posted could somebody let me know: 1)...
0
by: dartszeeland.tk | last post by:
Hi, i want to upload a file from my computer to a ftp..... this is the code: Inet.RemoteHost = "localhost" '(not ftp:// in front of it) Inet.RemotePort = "21" Inet.UserName = "user"...
0
by: AstrA | last post by:
Hi All Using the INET control to extract data from web sites and was told that the user agent should really be spoofed to make it look like a browser, as search engines sometimes black list...
4
by: Steen Gellett | last post by:
Hallo.....I have programmed with winsock for a while, but now I have set my eyes on Inet, but I'm totally blank........a few questions ?? Inet1.Protocol = icFTP......................I can see...
4
by: S.W. Rasmussen | last post by:
I have tried several times to get inet.execute to download a file with the icHTTP protocol without much success so far. I execute: Inet.Execute "http://www.domain/myfolder/myfile.file", "GET"...
0
by: jtmerch | last post by:
what's the best option for using the Inet control in VB.net? Is there a control that's built for the .net framework that's similar to or better than the old Inet control? I'm opening a URL and...
0
by: Pius | last post by:
Set Inet = Server.CreateObject("InetCtls.Inet.1") Inet.URL = "http://www.yahoo.com/" Inet.AccessType = icDirect Inet.Protocol = icHTTP Inet.RemotePort = 80 Inet.RequestTimeout = 60...
0
by: Rick | last post by:
Hi, I haven't been able to find a solution anywhere yet. I have a Vb6 application that has to be rewritten as a vb.net app and in the old application the inet control was set as: ...
2
by: Dan | last post by:
I developed a website that posts data to another url via the Inet object. I should mention that the posting code is wrapped in a VB 6 dll, and that dll is called from ASP. Here's the ASP code:...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.