alltimefav
Programmer
This in VB 6.0 with a command button works OK on the first site but fails on
the 2nd site with encoding error. I don't know how to fix this.
error on 2nd site is "System does not support the specified encoding."
Dim xml As Variant
Dim vresponse As Variant
On Error GoTo 10000
1000
Set xml = CreateObject("Msxml2.XmlHttp.4.0")
2500
xml.Open "GET", " False
3000
' Pull the data from the web page
xml.Send
vresponse = xml.responseText
Debug.Print "ALL OK"
4000
'now try another website
5500
xml.Open "GET", " False
6000
' Pull the data from the web page
xml.Send
vresponse = xml.responseText
Debug.Print "ALL OK"
7000
Exit Sub
10000
Debug.Print Error$, Str$(Err), Str$(Erl)
someone replied to me and I tried this:
There is not much you can do with responseText on that site I am afraid.
You might want to use responseBody or responseStream and try to read out
the bytes you get.
xml.responsebody gives
????????????????4?????????????????????????6?????????????????????=???????????
xml.responsestream says type mismatch
This is odd:
When looking at the server headers from alltimefavorites.org they have no
default character set
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Accept-Ranges: bytes
Content-Length: 6016
Content-Type: text/html; charset=none
Date: Tue, 12 Dec 2006 19:15:37 GMT
ETag: "6ec04b-1780-2e3ab340"
Last-Modified: Tue, 12 Dec 2006 00:15:33 GMT
Server: Apache
and alltimefavorites.com does have a default charset
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Date: Tue, 12 Dec 2006 19:23:00 GMT
Server: Apache
Could that be the issue?
the 2nd site with encoding error. I don't know how to fix this.
error on 2nd site is "System does not support the specified encoding."
Dim xml As Variant
Dim vresponse As Variant
On Error GoTo 10000
1000
Set xml = CreateObject("Msxml2.XmlHttp.4.0")
2500
xml.Open "GET", " False
3000
' Pull the data from the web page
xml.Send
vresponse = xml.responseText
Debug.Print "ALL OK"
4000
'now try another website
5500
xml.Open "GET", " False
6000
' Pull the data from the web page
xml.Send
vresponse = xml.responseText
Debug.Print "ALL OK"
7000
Exit Sub
10000
Debug.Print Error$, Str$(Err), Str$(Erl)
someone replied to me and I tried this:
There is not much you can do with responseText on that site I am afraid.
You might want to use responseBody or responseStream and try to read out
the bytes you get.
xml.responsebody gives
????????????????4?????????????????????????6?????????????????????=???????????
xml.responsestream says type mismatch
This is odd:
When looking at the server headers from alltimefavorites.org they have no
default character set
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Accept-Ranges: bytes
Content-Length: 6016
Content-Type: text/html; charset=none
Date: Tue, 12 Dec 2006 19:15:37 GMT
ETag: "6ec04b-1780-2e3ab340"
Last-Modified: Tue, 12 Dec 2006 00:15:33 GMT
Server: Apache
and alltimefavorites.com does have a default charset
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html
Date: Tue, 12 Dec 2006 19:23:00 GMT
Server: Apache
Could that be the issue?