Article View: borland.public.cppbuilder.database.ado
Article #3122Re: Problem About TADOQuery And MDAC 2.X?
From: Mark Guerrieri
Date: Sun, 10 Nov 2002 23:12
Date: Sun, 10 Nov 2002 23:12
76 lines
2870 bytes
2870 bytes
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:
<3dcee7e0$1@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!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailReferences:
<3dcc6f2b@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-10 15:20:03 PST From: "Mark Guerrieri" <markg11@comcast.net> Newsgroups: borland.public.cppbuilder.database.ado References: <3dcc6f2b@newsgroups.borland.com> Subject: Re: Problem About TADOQuery And MDAC 2.X? Date: Sun, 10 Nov 2002 18:12:35 -0500 Lines: 78 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 68.44.67.205 Message-ID: <3dcee7e0$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1036969952 68.44.67.205 (10 Nov 2002 15:12:32 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail