🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #841

Cannot perform this operation on closed dataset

#841
From: Danid
Date: Wed, 15 Jun 2005 16:47
37 lines
1526 bytes
Please help,

I have the following function:

TADOQuery *TCon :: select(String SQL)
{
  //qryData is a TADOQuery 
  try{
   qryData->SQL->Clear();
   qryData->SQL->Add(SQL);
   qryData->SQL->Open();
  } catch (EXception &e) {
   //
  }
  return qryData;
}

call this function in other classes:

TADOQuery *qry = new TADOQuery(Application);
TCon *con = new TCon(Application);

String SQL = "SELECT * FROM TABLE WHERE A = B"; //example
qry = con->select(SQL);
//do something with qry 

delete qry;
delete con;

This code works fine excepts that it sometimes rises the following error:
Cannot perform this operation on closed dataset

How can I solve this?
I looked on the internet but couldnt find a solution.

Thanks,
Technical Details
Message-ID: <42b05bb3$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,614415b022334e0e,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Danid" <danid@danid.com>
Sender: "Danid" <danid@danid.com>
Reply-To: "Danid" <danid@danid.com>
Subject: Cannot perform this operation on closed dataset
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 193.173.109.1     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <42b05bb3$1@newsgroups.borland.com>
Date: 15 Jun 2005 09:47:47 -0700
X-Trace: newsgroups.borland.com 1118854067 207.105.83.66 (15 Jun 2005 09:47:47 -0700)
Lines: 39
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail