First it fills an ADO recordset from the database.
Second it uses FSO to get a Files collection.
Then, for each file it sets the recordset's filter. The filter property on the recordset is basically the same thing as the WHERE clause in a SQL statement. So you set the filter property to the filename and check the RecordCount. If it is 0 then the filename is not in the recordset. If it is 1 then it is in the recordset and if it is greater than 1 then there is either a bug or the filename appears in the database twice.
If I were you, I'd not actually execute the FileDelete line until I was sure the script was working properly... don't want a bug to delete a bunch of good files.
Maybe to test it I would replace:
if rs.RecordCount = 0 Then
fso.DeleteFile PDF.Path
end if
With this:
if rs.RecordCount = 0 Then
MyAnswer = MsgBox(PDF.Path, 3, "Delete this?")
If MyAnswer = 2 Then
MsgBox "Bye bye"
Exit For
End If
If MyAnswer = 6 Then
fso.DeleteFile PDF.Path
End If
end if
And then just run it that way long enough to make sure it was doing what I wanted... you know, to debug and whatnot.
One thing I wasn't clear on is if the database holds only the file name or the full path? You might have to tweak the If/Then depending on what you've got.