OK, first of all you only have to post the question one time.
I do not know if you can do what you are trying, however I noticed a missing parenthesis...
What are you trying to accomplish by opening the connection here? It looks kind of odd to me, since I have learned that you should open the connection when needed.
Hope it helps :)