|
-
March 15th, 2001, 06:56 PM
#1
Link checker
ok, i am a complete new comer to VB other than playing with it in ASP pages, but i was wondering how hard it would be to write a short program which would connect to a (possibly remote) access database, check that all urls in a column are still active and remove the rows containing any dead links, after checking them 2 or 3 times??
-
March 16th, 2001, 01:53 AM
#2
Re: Link checker
'Reference: Microsoft ActiveX Data Objects 2.5 Library
'//////////Place this section at top of form
Private WithEvents rsADOSetRecord As ADODB.Recordset
Private adoDataGrid As ADODB.Connection
'/////////////
Private Sub Command1_Click()
Set adoDataGrid = New ADODB.Connection
Set rsADOSetRecord = New ADODB.Recordset
Dim TempURL as string
With adoDataGrid
.CursorLocation = adUseClient
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "c:\FileName.mdb", "admin", ""
End With
With rsADOSetRecord
.Open "SELECT FieldName FROM TableName", adoDataGrid, adOpenStatic, adLockOptimistic, adAsyncFetch
If Not .BOF Then
.MoveFirst
Do While Not .EOF
TempURL=!FieldName
'//here you can send the "TempURL" to a routine that will go on line and test its' validity.
.MoveNext
Loop
End If
.Close
End With
End Sub
* FieldName,TableName,FileName should all be replaced with your own names.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|