Article View: borland.public.cppbuilder.database.ado
Article #2686Re: how can I know the dataset in ADOQuery has been changed?
From: George Pestana
Date: Mon, 07 Apr 2003 18:55
Date: Mon, 07 Apr 2003 18:55
96 lines
4538 bytes
4538 bytes
At some point, the code will stop working with a "bookmark invalid" message.
The same thing happens if you save a bookmark, then close and reopen a
dataset - that makes the bookmarks invalid. You might be lucky in that the
bookmark still works, but that's just chance.
"Jonny" <jonny@nospam.jonnywilk.co.uk> wrote in message
news:3e70689b@newsgroups.borland.com...
> Maybe, but the code seems to work okay for me
>
> Jonny
>
> "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> news:3e6e15fa$1@newsgroups.borland.com...
> > Requery re-executes command and fetches all rows again. So bookmarks
> become
> > invalid. You may try primary key, save its value before requery and
locate
> > it after.
> >
> >
> > ----------------------------------------------------------------
> > Regards,
> > Viatcheslav V. Vassiliev
> > http://www.oledbdirect.com
> > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > and Interbase (through OLEDB) databases.
> >
> > "Jonny" <jonny@nospam.jonnywilk.co.uk> �������/�������� � ��������
> > ���������: news:3e6dac14$1@newsgroups.borland.com...
> > > I too had this problem
> > >
> > > I overcame it by using the requery() method on the ADOTable - however,
> > this
> > > would loose my place in the database so i used a bookmark to save it..
> The
> > > code looked a little bit like this:
> > >
> > > void TForm1::DB_Refresh()
> > > {
> > > TBookmark SavePlace;
> > > TExecuteOptions myOptions;
> > > myOptions << eoAsyncFetch ;
> > >
> > > // get a bookmark so that we can return to the same record
> > > SavePlace = ADOTable1->GetBookmark();
> > > // Re run the query
> > > ADOTable1->Requery(myOptions);
> > > // Now return to where we were before
> > > ADOTable1->GotoBookmark(SavePlace);
> > > ADOTable1->FreeBookmark(SavePlace);
> > > }
> > >
> > >
> > >
> > > Jonathan
> > >
> > >
> > > "Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
> > > news:3e684296@newsgroups.borland.com...
> > > > You can do this on client-side cursor with LockType =
> ltBatchOptimistic.
> > > In
> > > > this mode ADO caches data, updates, inserts, deletes etc. Look help
> for
> > > > FilterGroup property.
> > > >
> > > > ----------------------------------------------------------------
> > > > Regards,
> > > > Viatcheslav V. Vassiliev
> > > > http://www.oledbdirect.com
> > > > The fastest way to access MS SQL Server, MS Jet (MS Access)
> > > > and Interbase (through OLEDB) databases.
> > > >
> > > > "NEO" <glin@gri-china.com> �������/�������� � �������� ���������:
> > > > news:3e683f38@newsgroups.borland.com...
> > > > > for example , any changes made in MS Office Word is going to be
> > recorded
> > > ,
> > > > > and promots you before you exit without save.
> > > > >
> > > > > Does ADOQuery have any property or method to do the same thing?
> > > > >
> > > > > this matter has put me in the jam so long time.
> > > > >
> > > > > Thanks
> > > > > neo
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Technical Details
Message-ID:
<3e91c9fa$3@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!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:
<3e683f38@newsgroups.borland.com> <3e684296@newsgroups.borland.com> <3e6dac14$1@newsgroups.borland.com> <3e6e15fa$1@newsgroups.borland.com> <3e70689b@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10698b,99977fdb00087541 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2003-04-07 11:59:09 PST Reply-To: "George Pestana" <gpestana@nospam.pervasive.com> From: "George Pestana" <gpestana@nospam.pervasive.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3e683f38@newsgroups.borland.com> <3e684296@newsgroups.borland.com> <3e6dac14$1@newsgroups.borland.com> <3e6e15fa$1@newsgroups.borland.com> <3e70689b@newsgroups.borland.com> Subject: Re: how can I know the dataset in ADOQuery has been changed? Date: Mon, 7 Apr 2003 13:55:12 -0500 Lines: 98 Organization: Pervasive Software 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: 66.45.103.246 Message-ID: <3e91c9fa$3@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1049741818 66.45.103.246 (7 Apr 2003 11:56:58 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!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