Let $n$ be a positive integer, and let $x=\frac{\sqrt{n+2}-\sqrt{n}}{\sqrt{n+2}+\sqrt{n}}$ and $y=\frac{\sqrt{n+2}+\sqrt{n}}{\sqrt{n+2}-\sqrt{n}}$.

It is given that $14x^2+26xy+14y^2=2014$. Find the value of $n$.
1. Given the expressions for \( x \) and \( y \):
   \[
   x = \frac{\sqrt{n+2} - \sqrt{n}}{\sqrt{n+2} + \sqrt{n}}, \quad y = \frac{\sqrt{n+2} + \sqrt{n}}{\sqrt{n+2} - \sqrt{n}}
   \]
   We need to find the value of \( n \) given that:
   \[
   14x^2 + 26xy + 14y^2 = 2014
   \]

2. First, simplify the given equation by dividing it by 2:
   \[
   7x^2 + 13xy + 7y^2 = 1007
   \]

3. Notice that \( x \) and \( y \) are reciprocals:
   \[
   x \times y = \left( \frac{\sqrt{n+2} - \sqrt{n}}{\sqrt{n+2} + \sqrt{n}} \right) \left( \frac{\sqrt{n+2} + \sqrt{n}}{\sqrt{n+2} - \sqrt{n}} \right) = 1
   \]
   Hence, \( y = \frac{1}{x} \).

4. Substitute \( y = \frac{1}{x} \) into the simplified equation:
   \[
   7x^2 + 13x \left( \frac{1}{x} \right) + 7 \left( \frac{1}{x} \right)^2 = 1007
   \]
   Simplify:
   \[
   7x^2 + 13 + \frac{7}{x^2} = 1007
   \]

5. Rearrange the equation:
   \[
   7x^2 + \frac{7}{x^2} = 1007 - 13
   \]
   \[
   7x^2 + \frac{7}{x^2} = 994
   \]

6. Divide both sides by 7:
   \[
   x^2 + \frac{1}{x^2} = 142
   \]

7. Add 2 to both sides to form a perfect square:
   \[
   x^2 + \frac{1}{x^2} + 2 = 144
   \]
   \[
   \left( x + \frac{1}{x} \right)^2 = 144
   \]

8. Take the square root of both sides:
   \[
   x + \frac{1}{x} = \pm 12
   \]

9. Since \( x \) and \( y \) are positive, we take the positive value:
   \[
   x + \frac{1}{x} = 12
   \]

10. Recall the expressions for \( x \) and \( y \):
    \[
    x = \frac{\sqrt{n+2} - \sqrt{n}}{\sqrt{n+2} + \sqrt{n}}, \quad y = \frac{\sqrt{n+2} + \sqrt{n}}{\sqrt{n+2} - \sqrt{n}}
    \]
    Rationalize \( x \):
    \[
    x = \frac{(\sqrt{n+2} - \sqrt{n})(\sqrt{n+2} - \sqrt{n})}{(\sqrt{n+2} + \sqrt{n})(\sqrt{n+2} - \sqrt{n})} = \frac{n+2 - 2\sqrt{n(n+2)} + n}{2} = n + 1 - \sqrt{n(n+2)}
    \]

11. Similarly, rationalize \( y \):
    \[
    y = \frac{(\sqrt{n+2} + \sqrt{n})(\sqrt{n+2} + \sqrt{n})}{(\sqrt{n+2} - \sqrt{n})(\sqrt{n+2} + \sqrt{n})} = \frac{n+2 + 2\sqrt{n(n+2)} + n}{2} = n + 1 + \sqrt{n(n+2)}
    \]

12. Since \( x + \frac{1}{x} = 12 \):
    \[
    n + 1 - \sqrt{n(n+2)} + n + 1 + \sqrt{n(n+2)} = 12
    \]
    Simplify:
    \[
    2(n + 1) = 12
    \]
    \[
    n + 1 = 6
    \]
    \[
    n = 5
    \]

The final answer is \( \boxed{5} \).