p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access (http://p2p.wrox.com/forumdisplay.php?f=18)
-   -   URL Checker for a Microsoft Access 2003 Database (http://p2p.wrox.com/showthread.php?t=35583)

Corey November 29th, 2005 05:36 PM

URL Checker for a Microsoft Access 2003 Database
 
Hello again.

I’m looking for some help or information on a URL Checker for a Microsoft Access 2003 Data base.

If anyone can send me information on how I would create this or where I might be able to find the information please do.

Thanks

Corey



dartcoach November 29th, 2005 09:49 PM

What exactly do you mean by a url checker?

Kevin

dartcoach

Corey November 30th, 2005 11:51 AM

I would like to be able to verify a list of web links are working


SerranoG November 30th, 2005 04:14 PM

In order for something like this to work, Microsoft Internet Explorer (or Netscape) has to communicate back to Access of the result of the load. There is nothing I know of that does this.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

echovue November 30th, 2005 05:03 PM

I think you might be able to do it by setting up the following...

Add the Microsoft Brower ActiveX Control to your form.
Set the address to the URL of the first record.
On the Download_Complete event of the browser, check the InnerHTML property of the browser.
You will then need a way to tell if the page downloaded or not - Perhaps you could check to see if the first few lines match the HTML for a Page Not Found error.
When that is figured out, just load the next address.

I have some similar code that I used to strip a bunch of information from an online database for one of my customers - If you need a hand, I would happy to post some of it when I get home tonight. Just let me know

HTH

Mike


Mike
EchoVue.com

Corey November 30th, 2005 06:05 PM

Mike,

Why an I not able to find teh Microsoft Brower ActiveX Control?


echovue November 30th, 2005 06:33 PM

Sorry, my bad - It is the 'Microsoft Web Browser' that you want. If you still can't find it, it should be under the aditional controls option on the toolbox.

Mike
EchoVue.com

Corey November 30th, 2005 07:00 PM

Hi again Mike,

I was able to find the Microsoft Web Browser, and added it to my form.

Could you help me understand what you meant by”
Set the address to the URL of the first record. On the Download_Complete event of the browser, check the InnerHTML property of the browser.

Thanks for the clarification.

Corey



echovue November 30th, 2005 09:23 PM

Alright - here you go, this will need a little tweaking but should get you the basic idea...

I have a form with a text box - txtAddress
                    a browser - ocxBrowser
                     a button - cmdGo

What it does it to take the source code of the page and saves it in a file C:\source.txt. I am thinking you could either just check the innerHTML property for whatever the code looks like on a page not found, or check out the contents of the file.

Code:

Option Compare Database
Option Explicit

    Dim objIE As SHDocVw.InternetExplorer
    Dim strURL As String
    Dim strFileName As String

Private Sub cmdGo_Click()
    strURL = txtAddress
    Set objIE = Me.ocxBrowser.Object
    objIE.Navigate strURL
End Sub


Private Sub Form_Load()
    strURL = "http://echovue.com/"
    Set objIE = Me.ocxBrowser.Object
    objIE.Navigate strURL
End Sub

Private Sub ocxBrowser_DownloadComplete()
    On Error Resume Next
    strFileName = "C:\Source.txt"
    Set objIE = Me.ocxBrowser.Object
    Open strFileName For Output As #1
    Print #1, objIE.Document.body.innerHTML
    Close #1
    txtAddress = objIE.LocationURL
    Beep
End Sub


Mike
EchoVue.com

Corey December 8th, 2005 12:29 PM

Hi again Mike –

Sorry I wasn’t able to get back to you sooner, I got pulled into another project.

I tried added the Web Browser within access and I’m not sure if it’s working or how I can check to see if it is working. It just makes a black box.
This is the first time I ever user this function so I apologize for sounding so ignorant.

Any chance you can help me test this –

Corey




All times are GMT -4. The time now is 11:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.