I can not see from what base class you derive you class. I assume you have a Command object.
So what happens is that you already performed an operation with an Open call. But after an open you need a Close operation before you can use the command again with a new statement and Open operation.
Look at the m_spCommand member.