473,326 Members | 2,805 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,326 software developers and data experts.

Download Code from an Internet Page....

Hi, i'm italian...excuse me for my bad english.
I've a problem.
I need to download the code of a web page, but the translation of many
character is invalid.
An example is "à" wich is translate in "?", ecc...., or is become a square!!
I need to import it from the web page but in the right character!
I work connected to internet and with access 2003.
The code i've used is the follow:

Dim oHttp As Object
Dim txtRequestString, stringa2 As String
Set oHttp = CreateObject("MSXML2.XMLHTTP")
txtRequestString = www
oHttp.Open "GET", txtRequestString, False
oHttp.Send
txtHTML = oHttp.responsetext

in txtHTML i've the code downloaded from the page but it is made of pipe
(||||) or ?? or square. I need, instead, that the code was downloading
normally.

Excuse me for the english....in Italy, english's teachers are very bad....
:)

thank you

ps: (i can also change object to use if you find a different solution)
Nov 13 '05 #1
1 1647
This works for me. That is, it downloads all the files in the server
folder to my local computer.
It also, (would be removed if not needed), produces a text/ascii
manifestation of the files, and for want of something better to do,
prints that in the immediate window. The text and ascii attributes can
be changed.

Conditions are (mostly a guess) that your server is all MS, that you
have the latest MDAC installed and, of course, that you have access to
the site (username and password). If you try running this code per se I
STRONGLY HOPE it will fail as you will be prompted for a user name and
password.

As always, ... news clients may insert line feeds which will create
syntax errors.

Option Explicit

Public Sub GetRemoteFiles( _
ByVal url As String, _
ByVal destination As String)

Dim c As ADODB.Connection
Dim r As ADODB.Record
Dim rr As ADODB.Record
Dim rs As ADODB.Recordset
Dim s As ADODB.Stream
Set c = New ADODB.Connection
Set r = New ADODB.Record
Set rr = New ADODB.Record
Set s = New ADODB.Stream

url = "url=" & url
c.Open url

r.ActiveConnection = c
r.Open
rr.ActiveConnection = c
Set rs = r.GetChildren
With rs
Do While Not .EOF
r.CopyRecord rs.Fields(0).Value, destination &
rs.Fields(0).Value
rr.Open rs.Fields(0).Value
With s
.Open rr, adModeRead, adOpenStreamFromRecord
.Charset = "ascii"
.Type = adTypeText
Debug.Print .ReadText
.Close
End With
rr.Close
.MoveNext
Loop
End With
r.Close
c.Close
End Sub

Sub TestGetRemoteFiles()
GetRemoteFiles "http://www.ffdba.com/downloads/", "c:/temp/"
End Sub

tranky wrote:
Hi, i'm italian...excuse me for my bad english.
I've a problem.
I need to download the code of a web page, but the translation of many
character is invalid.
An example is "à" wich is translate in "?", ecc...., or is become a square!!
I need to import it from the web page but in the right character!
I work connected to internet and with access 2003.
The code i've used is the follow:

Dim oHttp As Object
Dim txtRequestString, stringa2 As String
Set oHttp = CreateObject("MSXML2.XMLHTTP")
txtRequestString = www
oHttp.Open "GET", txtRequestString, False
oHttp.Send
txtHTML = oHttp.responsetext

in txtHTML i've the code downloaded from the page but it is made of pipe
(||||) or ?? or square. I need, instead, that the code was downloading
normally.

Excuse me for the english....in Italy, english's teachers are very bad....
:)

thank you

ps: (i can also change object to use if you find a different solution)

Nov 13 '05 #2

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

Similar topics

3
by: James Kirk | last post by:
The script below allows me to link to a file and as the user clicks to download, the 'File Download' windows appears as normal, and the user can download... The original page is then redirected...
3
by: Michael | last post by:
I am trying to allow a user to view a PDF in a new window. I currently have this working using the following: <a href="./pdf.do?parameter=01121980" target="top"><b>pdf</b></a> The problem...
5
by: Baren | last post by:
Hi! I am using impersonate="true" to upload and download files from a network share. I have created common users on both the webserver and the file server. The user has permission to the...
18
by: jmd | last post by:
Hello, I posted the following in the C# forum but without one answer. But perhaps now in vb.net someone has some guidelines ! This is my question : I want to write a vb.net program that does...
3
by: laredotornado | last post by:
Hi, This problem only affects PC IE. On a secured page (a page visited via https), there is a link that reads -- "Download HTML File". The link connects to this page <?php...
1
by: koraykazgan | last post by:
Hi all, I have written an ASP.Net 2.0 Web Application. I am using WinXP Pro SP 2 and have IIS 5.1 on my system, where the Application is developed. After finishing implementation I have...
2
by: JP | last post by:
Hi List, I am trying to create an application which is a Download Manager. I want this to be attached to the IE so if user clicks a link on the page to download something and which basically...
2
by: =?Utf-8?B?SHVzYW0=?= | last post by:
Hi EveryBody: I'm working with project in my company by using ASP.Net 2.0 that allow the users to upload and download files to web site in the internet as backup. The user will first upload his...
2
by: =?Utf-8?B?U1VOTlk=?= | last post by:
Hi I have a web application(website) from which i generate reports. I code behind used is asp.net. When i give a small date range to generate reports it works fine, but when i give a big date range...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.