PC Review


Reply
Thread Tools Rate Thread

Problem with Rollback in DAO 3.6

 
 
=?Utf-8?B?Q29saW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
I am having a problem when doing a rollback using DAO 3.6 in VB6 on both
Access 2000 and Access 97 databases. The sequence of instructions are as
follows:

Open a recordset using DAO
using .FindFirst find the first record in the recordset...OK
Begin a transaction
using .FindFirst find the second record in the recordset...OK
rollback
using .FindFirst try to find the second record in the recordset...it is not
found

After the rollback none of the records except the first appears to exist in
the recordset. Requerying the recordset gets all the records back again. The
recordset is a simple (no joins, no ordering) opened with dbOpenDynaset,
dbInconsistent, dbOptimistic using a "SELECT * FFROM ..."). If I use DAO 3.51
(on the Access 97 database) there is no problem. I am using Windows XP and
the version of dao360.dll is 3.60.8618.0 which I believe is the latest
version for XP SP2.

Can anyone confirm this behaviour and does anyone know of a fix for it?

--
Colin
 
Reply With Quote
 
 
 
 
IUnderstandSomething
Guest
Posts: n/a
 
      2nd Aug 2007
On Aug 2, 11:34 am, Colin <Co...@discussions.microsoft.com> wrote:
> I am having a problem when doing a rollback using DAO 3.6 in VB6 on both
> Access 2000 and Access 97 databases. The sequence of instructions are as
> follows:
>
> Open a recordset using DAO
> using .FindFirst find the first record in the recordset...OK
> Begin a transaction
> using .FindFirst find the second record in the recordset...OK
> rollback
> using .FindFirst try to find the second record in the recordset...it is not
> found
>
> After the rollback none of the records except the first appears to exist in
> the recordset. Requerying the recordset gets all the records back again. The
> recordset is a simple (no joins, no ordering) opened with dbOpenDynaset,
> dbInconsistent, dbOptimistic using a "SELECT * FFROM ..."). If I use DAO 3.51
> (on the Access 97 database) there is no problem. I am using Windows XP and
> the version of dao360.dll is 3.60.8618.0 which I believe is the latest
> version for XP SP2.
>
> Can anyone confirm this behaviour and does anyone know of a fix for it?
>
> --
> Colin


You start the transaction before the OpenRecordset and use rollback if
things go wrong in the error handeling. What is it you want to do?

Sincerely

Hans Kristian

 
Reply With Quote
 
=?Utf-8?B?Q29saW4=?=
Guest
Posts: n/a
 
      2nd Aug 2007
Hi Hans,

The recordset is opened before the transaction is begun. In the real
application I would be working through the recordset in a loop and would, at
some point, begin the transaction. I would then edit and update the current
record in the recordset. Once I have edited and updated the record I then do
some checks to see if the data we had changed is OK to change (this is
actually quite a complex validation process). If something fails to validate
then I need to report this to the user and to rollback the changes I made to
that record so I either commit the transaction or roll it back. I then move
on to the next record in the recordset and continue round the loop until EOF.
I found that I was exiting the loop early if ANY record failed during
validation as it reached EOF immediately. So I wrote a really stripped down
version of the original and discovered the problem as described in my first
post.

--
Colin


"IUnderstandSomething" wrote:

> On Aug 2, 11:34 am, Colin <Co...@discussions.microsoft.com> wrote:
> > I am having a problem when doing a rollback using DAO 3.6 in VB6 on both
> > Access 2000 and Access 97 databases. The sequence of instructions are as
> > follows:
> >
> > Open a recordset using DAO
> > using .FindFirst find the first record in the recordset...OK
> > Begin a transaction
> > using .FindFirst find the second record in the recordset...OK
> > rollback
> > using .FindFirst try to find the second record in the recordset...it is not
> > found
> >
> > After the rollback none of the records except the first appears to exist in
> > the recordset. Requerying the recordset gets all the records back again. The
> > recordset is a simple (no joins, no ordering) opened with dbOpenDynaset,
> > dbInconsistent, dbOptimistic using a "SELECT * FFROM ..."). If I use DAO 3.51
> > (on the Access 97 database) there is no problem. I am using Windows XP and
> > the version of dao360.dll is 3.60.8618.0 which I believe is the latest
> > version for XP SP2.
> >
> > Can anyone confirm this behaviour and does anyone know of a fix for it?
> >
> > --
> > Colin

>
> You start the transaction before the OpenRecordset and use rollback if
> things go wrong in the error handeling. What is it you want to do?
>
> Sincerely
>
> Hans Kristian
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLTransaction rollback problem mahajan.sanjeev@gmail.com Microsoft Dot NET 2 6th May 2005 12:43 AM
BeginTrans - Rollback problem Jim Bunton Microsoft Access 6 21st Jan 2005 08:01 PM
Rollback W2k to NT Problem alvin Microsoft Windows 2000 Setup 1 2nd Oct 2003 01:10 AM
Problem on ROLLBACK Charles Rumbold Microsoft ADO .NET 6 23rd Sep 2003 07:50 PM
Win 2000 SP4 Rollback problem Victor Lee Microsoft Windows 2000 Windows Updates 1 3rd Jul 2003 01:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:20 PM.