🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: MDAC2.6 crashing with ADOUpdate 1 applied

#4620
From: Steve Love
Date: Thu, 08 Nov 2001 11:43
65 lines
2703 bytes
> Hi all,
> I recently applied the ADOExpress patch to get around the Bof/Eof problem
> in MDAC 2.6. I'm now experiencing a EAccessViolation for a
> TADOQuery->ExecSQL().

> I'm assuming it's MDAC – I'm using Win2k/Office2k, and this problem is
> not reproducable on other machines of similar config, running earlier
> MDAC versions (2.1 or 2.5 being popular).

In an update to this, I've managed to re-create the problem in a small 
program. It occurs when re-using a TADOQuery component under MDAC 2.6 
and above:

1) Create a standard application.
2) Create a data module, and add a ADOConnection and ADOQuery component. 
Attach
	to your favourite database.
3) Make a pointer to the data module a member of the form class, and 
create it
	using new in the form's constructor with Application as the owner; 
	delete it in the dtr.
3) Add 2 buttons to the form, and add the following code:

void __fastcall TForm1::Button1Click( TObject * Sender )
{
	db->ADOQuery1->Active = false;
	db->ADOQuery1->SQL->Clear();
	db->ADOQuery1->SQL->Add( "SELECT * FROM TABLE1" );
	db->ADOQuery1->Active = true;
}

void __fastcall TForm1::Button2Click( TObject * Sender )
{
	db->ADOQuery1->Active = false;
	db->ADOQuery1->SQL->Clear();
	
	//
	// This can be any update query AFAICT
	//
	db->ADOQuery1->SQL->Add( "DELETE FROM TABLE1" );
	db->ADOQuery1->ExecSQL();
}

Run the program. Clicking button1 several times is OK. So is clicking 
Button2. 
The error occurs when I click Button1 followed by Button2 – i.e. A SELECT 
query
followed by an UPDATE query. In reverse, no errors occur.

> Anybody come across this one?

> Cheers
> Steve

Steve
Technical Details
Message-ID: <20011108.11435975@sl.engineering>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <20011107.11520368@sl.engineering>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10698b,869d1b579a11479d
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2001-11-08 03:38:54 PST
From: Steve Love <steve.love2@virgin.net>
Date: Thu, 08 Nov 2001 11:43:59 GMT
Message-ID: <20011108.11435975@sl.engineering>
Subject: Re: MDAC2.6 crashing with ADOUpdate 1 applied
Reply-To: Steve Love <steve.love2@virgin.net>
References: <20011107.11520368@sl.engineering>
X-Priority: 3 (Normal)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Newsgroups: borland.public.cppbuilder.database.ado
X-Newsreader: Mozilla/3.0 (compatible; StarOffice/5.2;Win32)
NNTP-Posting-Host: 213.38.79.146
X-Trace: dnews 1005219441 213.38.79.146 (8 Nov 2001 03:37:21 -0800)
Lines: 66
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews