Validating URLs

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

I have a series (1,000 to 2,000) of web URLs that I need
to validate that they produce a web page, rather than
returning error 404. This will be a program that will be
run regularly.

Has any one done this previously?

I have looked at the Microsoft Web Browser ActiveX
control, but have been unable to get the desired reults.

Any suggestions would be greatly appreciated.

Wayne
 
See whether this works for you.

Dim objWeb As Object
Dim strURL As String

Set objWeb = CreateObject("Microsoft.XMLHTTP")

objWeb.Open "GET", strURL, False
objWeb.send

MsgBox objWeb.status
 
Douglas J. Steele said:
See whether this works for you.

Dim objWeb As Object
Dim strURL As String

Set objWeb = CreateObject("Microsoft.XMLHTTP")

objWeb.Open "GET", strURL, False
objWeb.send

MsgBox objWeb.status

Doug, that's a lot simpler than what I did when I had to do something
similar! What *is* that?

FWIW, when I did it, I used the Internet Transfer Library from
http://www.mvps.org/access/modules/mdl0037.htm .

Wayne, I can provide the code I used if you need it, but Doug's code
sure looks a whole lot better.
 
Thank you for the info. I ran the code and it works well
on most URLs. On some it locks up. Access continues to
churn for 5 - 10 minutes on a URL, never comes back. Is
there a way to have it stop trying after a set amount of
time, IE timed out, rather than continuing indefinoiately?

Thanks again for your help. I would not have come up with
this on my end.

Wayne
 
I don't see anyway, but I'm looking at an old version of XMLHTTP (version
2).

There is an abort method: perhaps you can call that after a fixed period of
time.

I haven't used it, but I believe it would be simply:

objWeb.abort
 
Back
Top