🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ADO Exception

#2798
From: Sky
Date: Thu, 20 Mar 2003 09:04
53 lines
2930 bytes
Thanks for you help, But I want to know how to catch the error
if the AutoEdit property set false or Edit() method is not been called.
It always show "DataSet not in edit or insert mode",
I want catch this error and cancel rejigger. Any hint? TIA

Sky


"Alex Ip" <alex.ip@bigpond.com> wrote in message
news:3e7956dc$1@newsgroups.borland.com...
> Hello Sky...
>
> A TDataSet object MUST be in edit mode (either by having their AutoEdit
> property set to true or by having their Edit() method called) before the
> current record can have its field values changed. The changes to the
current
> record are not actually posted to the database until you go to another
> record or explicitly call the Post() method of the dataset. If you wish to
> cache changes to multiple records, you should look at setting the
dataset's
> CachedUpdate property to true (if your database engine supports this) or,
> better still, use a TClientDataSet object
>
> HTH...
>
> Regards,
>
>     Alex.
>
> "Sky" <akeehuang@163.net> wrote in message
> news:3e758449@newsgroups.borland.com...
> > I am using ADO to operate database,
> > TADOConnection/TADOQuery/TDataSource/TDBEdit has been used,
> > if I set the AutoEdit property of TDataSource true,
> > I can use it normally, the data in TDBEdit can save automatically.
> > But if i set AutoEdit property false(I want save record manually till
all
> > data input completely),
> > But It always raise exception class EDatabaseError when i modify the
data
> > and change the focus of active control, it show "DataSet not in edit or
> > insert mode,
> > I try to use the OnDatachange and OnUpdataData event of TDataSource
> > or the OnEditError and BeforeEdit event of TADOQuery to verify this,
> > But it always throw this exception first before these event had been
> > triggered.
> >
> > Sky
> >
> >
> >
>
>
Technical Details
Message-ID: <3e798429@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3e758449@newsgroups.borland.com> <3e7956dc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,e766e18548493c07
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-03-20 01:09:09 PST
Reply-To: "Sky" <akeehuang@163.net>
From: "Sky" <akeehuang@163.net>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3e758449@newsgroups.borland.com> <3e7956dc$1@newsgroups.borland.com>
Subject: Re: ADO Exception
Date: Thu, 20 Mar 2003 17:04:36 +0800
Lines: 55
Organization: CK
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6700
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700
NNTP-Posting-Host: 210.14.178.241
Message-ID: <3e798429@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1048151081 210.14.178.241 (20 Mar 2003 01:04:41 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail