πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: TADODataSet

#451
From: Rudy Veeneman
Date: Fri, 24 Mar 2006 08:02
58 lines
2467 bytes
We had the same problem with TADODataSet in CBuilder. We found a workaround 
by using a "wrapper class".

class TMyDataSet : public TADODataSet
{
private:

protected:

public:
  __fastcall virtual TMyDataSet (Classes::TComponent* AOwner);
  __fastcall virtual ~TMyDataSet (void);
};

__fastcall TMobaDataSet::TMobaDataSet(Classes::TComponent* AOwner)
  : TADODataSet(AOwner)
{
}

__fastcall TMobaDataSet::~TMobaDataSet(void)
{
}

Create a TMyDataSet object though new operator:
  TMyDataSet* objDataSet = new TMyDateSet(NULL);

Other way to solve the problem is to use TADOQuery in stead of TADODataSet.
In CBuilder 'new TADOQuery(NULL)' does not give problems with codeguard

Rudy







"Ars Nova" <lmuniz@ars-nova.net> schreef in bericht 
news:441e876e$1@newsgroups.borland.com...
>
> I want to create a TADODataSet object through new operator, and I've 
> probed with:
>
>     TADODataSet * objDataSet;
>
>     objDataSet = new TADODataSet(NULL);
>     or
>     objDataSet = new TADODataSet(this);
>     where 'this' is a    TADOConnection object reference.
>
> In both cases this generates the follow Codeguard:
> "Method called on illegally casted object: Attempt to access 608 byte(s) 
> at 0x01214658. The 'this' pointer points to heap block 0x01214658 which is 
> only 604 bytes long."
>
> How can I do it?
>
> Thank you very muchοΏ½ 
Technical Details
Message-ID: <4423a7d8@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!hwmnpeer01.lga!hwmedia!news.highwinds-media.com!peer01.cox.net!cox.net!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <441e876e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5ffca2f3a24d26cd
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
Reply-To: "Rudy Veeneman" <rv@moba.nl>
From: "Rudy Veeneman" <rv@moba.nl>
Newsgroups: borland.public.cppbuilder.database.ado
References: <441e876e$1@newsgroups.borland.com>
Subject: Re: TADODataSet
Date: Fri, 24 Mar 2006 09:02:28 +0100
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 212.142.8.15
Message-ID: <4423a7d8@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1143187416 212.142.8.15 (24 Mar 2006 00:03:36 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!atl-c05.usenetserver.com!news.usenetserver.com!cycny01.gnilink.net!hwmnpeer01.lga!hwmedia!news.highwinds-media.com!peer01.cox.net!cox.net!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail