Article View: borland.public.cppbuilder.database.ado
Article #3126Re: Problem About TADOQuery And MDAC 2.X?
From: Mountain Lan
Date: Thu, 14 Nov 2002 01:53
Date: Thu, 14 Nov 2002 01:53
102 lines
4172 bytes
4172 bytes
I think I've found the bug in it. The envionment of TADOQuery doesn't be
cleaned up when the component is closed. If I close the connection to
database manually, or set the property 'KeepConnection' of TADOConnection to
be Fasle and make sure that there is not dataset opened at the same time,
the bug I mentioned before will not appear. Unfortunately, I can't garantee
that the connection is closed when I submit a new SQL.
There is another way to avoid this bug. Set the cursor type of TADOQuery
component to be 'clUseServer'. But it's not a good idea, because server side
curser is unflexible.
Further more, I tried my test case on BCB6, the result is the same as which
on BCB5. Is it a bug of BCB, or MDAC 2.6 and 2.7?
Help!
Mountain
"Mark Guerrieri" <markg11@comcast.net> д����Ϣ����
:3dcee7e0$1@newsgroups.borland.com...
> I have used BCB5/ADOExpress with all versions of Windows and all version
of
> MDAC (up to 2.7) and have not encountered any problems like that.
>
> If your recordset is not read only or disconnected, why not just query the
> record in question, then
>
> ADOQuery1->Edit();
> ADOQuery1->FieldByName("STATUS")->AsString = "A";
> ADOQuery1->Post();
>
> or better yet, use a TADOCommand object to execute SQL commands that don't
> return recordsets.
>
> I'm not saying there is no problem just because I have not encountered
one,
> but using command objects for UPDATE commands always works for me.
>
> Mark
>
> "Mountain Lan" <swatow@sina.com> wrote in message
> news:3dcc6f2b@newsgroups.borland.com...
> > Hi, friends,
> >
> > I am using BCB5 with SP1 and ADOExpress SP. My program works well on
> Windows
> > 2000(SP3). But when softwares, which upgrade MDAC (such as SQL Server
> 2000,
> > Visual Studio .Net, and so on) installed on my computer, my program
> crashed.
> > My program can't run on Windows XP either, which has a newer MDAC too.
> >
> > There is something wrong with TADOQuery when working with newer MDAC. I
> > found that TADOQuery component couldn��t execute a UPDATE or INSERT
> command
> > once it had been used to retrieve dataset using SELECT command. My test
> > codes are very simple:
> >
> >
> >
> > ADOQuery1->SQL->Text = "SELECT * FROM SYS_USER";
> >
> > ADOQuery1->Open();
> >
> > ADOQuery1->Close();
> >
> >
> >
> > ADOQuery1->SQL->Text = "UPDATE SYS_USER SET STATUS = 'A'";
> >
> > ADOQuery1->ExecSQL();
> >
> >
> >
> > An exception is raised here: Access violation at address xxxxxx in
> > msado15.dll.
> >
> >
> >
> > If I never use TADOQuery component to open a dataset, but use it to
update
> > data only, this exception will never be raised.
> >
> >
> >
> > What's wrong in it? I've tried to install MDAC 2.6 SP1, MDAC2.6 SP2,
MDAC
> > 2.7 on my computer, but couldn't eliminate this error. Thank you very
> much!
> >
> >
> >
> > Mountain
> >
> >
> >
> >
> >
> >
> >
>
>
Technical Details
Message-ID:
<3dd30248@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newspump.sol.net!mango.news.easynet.net!easynet.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cyclone.bc.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3dcc6f2b@newsgroups.borland.com> <3dcee7e0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,342bf5b350cbdf1 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-11-13 18:14:02 PST Reply-To: "Mountain Lan" <swatow@sina.com> From: "Mountain Lan" <swatow@sina.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3dcc6f2b@newsgroups.borland.com> <3dcee7e0$1@newsgroups.borland.com> Subject: Re: Problem About TADOQuery And MDAC 2.X? Date: Thu, 14 Nov 2002 09:53:36 +0800 Lines: 104 Organization: Ideal Tech X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 61.174.183.210 Message-ID: <3dd30248@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1037238856 61.174.183.210 (13 Nov 2002 17:54:16 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newspump.sol.net!mango.news.easynet.net!easynet.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cyclone.bc.net!news-out.newsfeeds.com!propagator2-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail