🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

I got and error with CodeGuard and I don't know why

#38
From: Oscar megia.oscar
Date: Fri, 27 Jun 2008 11:57
35 lines
2031 bytes
Hi

I have a TADOConnection object in a form connected to a SQLServer database.

When I try to open the object:

if (!ADOConnection->Connected) ADOConnection->Open();

CodeGuard shows this error (I compiled with full debug in Borland C++ Builder 6 and also with C++ Builder 2007 with the same problem):
Method called on illegally casted object
Attempt to access 224 byte(s) at 0x010C2460. The 'this' pointer points to heap block 0x010C2460 which is only 220 bytes long.
0x010C2460
   -Adodb::TADOConnection::Open()
   -TForm1::TForm1(Classes::TComponent *)
   -TFormulario::Button3Click(const System::TObject *)
   -0x004EF1F2
   -0x004F20CC
   -Controls::_16864 + 0x28
The memory block (0x010C2460) [size: 220 bytes] was allocated with SysGetMem
    -System::__linkproc__ GetMem + 0xB
    -0x004855EA
    -0x00485836
    -0x00485775
    -Classes::TComponent::ReadState + 0x6
    -0x004D9D92

I've found a solution: Comment this line and when I open the TADODataSet (TADODataSet->Connection=TADOConnection) it opens both without error.

My question is Why I cannot open the TADOConnection without CodeGuard error?

There is a bug in the TADOConnection VCL object?

Thanks in advance
Oscar
Technical Details
Message-ID: <4864d5ae$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,d1143d1d5ce6f94c,start
X-Google-Attributes: gid10698b,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Oscar" megia.oscar
Sender: "Oscar" megia.oscar
Reply-To: "Oscar" megia.oscar
Subject: I got and error with CodeGuard and I don't know why
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 213.98.121.220     
NNTP-Posting-Host: 207.105.83.66
Message-ID: <4864d5ae$1@newsgroups.borland.com>
Date: 27 Jun 2008 04:57:34 -0700
X-Trace: newsgroups.borland.com 1214567854 207.105.83.66 (27 Jun 2008 04:57:34 -0700)
Lines: 35
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail