473,549 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6044
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.goo gle.com...
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message
news:<be******* ***@sparta.btin ternet.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.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


Jul 17 '05 #2
MN
"Laphan" <ne**@FrozenMol es.co.uk> wrote in message news:<be******* ***@sparta.btin ternet.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
1937
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) Why can I download Access DBs from FTP sites in the default mode (icString??) and everything looks OK (eg, file/byte size, functionality, etc), when...
0
4935
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" Inet.Password = "password"
0
2865
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 submitters who don't use browsers to submit. My queries are: 1) What header does the INET send to a web server?
4
8363
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 what this is Inet1.RemotePort = Text4.Text......... Whats the use ?? Inet1.URL = Text1.Text....................Can this be an IP adresse...
4
13877
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" monitor the progress in Inet_StateChanged(ByVal State ByVal Integer)
0
3190
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 port and passing data to that URL and port. The inet control worked fine in VB 6 for this, any ideas on VB.net? Thanks for any help.
0
5408
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 response.write(Inet.ResponseCode) I got this piece of code from some forum on the web. The responsecode is supposed to return whether the connection is...
0
1381
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: inet.Protocol = icHTTP inet.OpenUrl(http://user:password@www.somesite.com/Login) format was used. I have to take this exact same concept and accomplish it in...
2
2379
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: <% Dim objPostWrapper Set objPostWrapper = Server.CreateObject("MyDLL.PostWrapper")
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7726
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7819
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1953
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.