Example 10 The equation $x^{2}+p x+1997=0$ has exactly two integer roots $x_{1} 、 x_{2}$. Then the value of $\frac{p}{\left(x_{1}+1\right)\left(x_{2}+1\right)}$ is
(A) 1
(B) -1
(C) $-\frac{1}{2}$
(D) $\frac{1}{2}$
Solution: Given $|1 x_{1} x_{2}=1997$, and 1997 is a prime number, we know
$$
\begin{array}{l}
x_{1}=1, x_{2}=1997, \\
p=-\left(x_{1}+x_{2}\right)=-1998 . \\
\text { The original expression }=\frac{-1998}{2 \times 1998}=-\frac{1}{2} .
\end{array}
$$

Therefore, the answer is (C).