Let $X=\operatorname{Spec}(A)$ be the spectrum of the comm. ring $A$ and let $\mathcal{O}$ be the associated sheaf of rings, i.e. for $U \subseteq X$ open, $\mathcal{O}(U)$ is the ring of all functions $s: U \to \prod_{p \in U}A_p$ such that for all $p \in U$ there is an open neigbourhood $V \subseteq U$ of $p$ and there are $a \in A, f \in A \setminus \bigcup_{q \in V}q$ with $s(q) = a/f$ for all $q \in V$.
Question: What is $\operatorname{Spec}\mathcal{O}(U)$ ?
There are two special cases for $U$ that are easy to handle:
(1) We have $\mathcal{O}(X)=A$ and thus $\operatorname{Spec}\mathcal{O}(U)(X)=X$.
(2) For a principal open subset $D(f),\, \,\mathcal{O}(D(f))=A_f$ and thus $\operatorname{Spec}\mathcal{O}(D(f))=D(f)$.
Therefore I suppose $\operatorname{Spec}\mathcal{O}(U)=U$. I found the map $$U \to \operatorname{Spec}\mathcal{O}(U),\, q \mapsto \mathcal{O}(U) \cap \prod_{p \in U} B_p$$ where $B_p: =A_p$ for $p \neq q$ and $B_q := qA_q$. But I'm not able to show that it is surjective.
Any hint or reference is appreciated. Please note that the question is no homework, but an attempt to get a better understanding of the ring $\mathcal{O}(U)$.