🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
1 messages
1 total messages Started by Oscar megia.oscar Fri, 27 Jun 2008 11:57
I got and error with CodeGuard and I don't know why
#38
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads