Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 reuse ADO object in C++

Author  Topic 

zurbum
Yak Posting Veteran

55 Posts

Posted - 2004-11-26 : 16:09:43
I use ADO in my c++ application.
I implemented my own class for working with ado objects, which only wraps ADO instructions, but it looks better.

adoset.Open("select * from persons");
while (!adoset.IsEOF())
{
...
adoset.MoveNext();
}
adoset.Close();

Is it possible to reuse the object, for example
adoset.open("DECLARE @a int\nSET @a=5\nSELECT * FROM PERSON");
while (!adoset.IsEOF())
{
...
adoset.MoveNext();
}
adoset.open("SELECT @a"); <---@a doesn't exists here anymore

adoset.close();

Is this possible?

   

- Advertisement -