I've spotted a bug:
P_Value = (P.strip(".mdb"))
The .strip() method DOESN'T strip off a string, it strips CHARACTERS off
BOTH ends.
P_Value will be P but with any number of the characters ".", "m", "d" or
"b" stripped off both ends, for example, if P == "my_database.mdb" then
P_Value will be "y_database".
You should do something like:
if P.endswith(".mdb"):
P_Value = P[ : -4]
else:
P_Value = P
Another point: you're recording the valid domains in a list and then
checking with:
if P_Value in domainList:
This will perform a linear search of the list, which can be slow if the
list is long.
It would be much more efficient to put the domains in a set instead.
Checking for the presence of an item in a set is fast.