PC Review


Reply
 
 
=?Utf-8?B?UGV0ZXI=?=
Guest
Posts: n/a
 
      29th Jun 2004
I am doing several tables update and I am using Begin and Commit Trans method. After the CommitTrans, I try to requery one of the tables (table3), I can get all expected records. But if I try to open it, I get runtime error "3021" saying "Either BOF or EOF is true, or the current record has been deleted. Requested operation requires a current record."

Can anyone help me to understand this?

Thanks
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      29th Jun 2004
We might need a bit more detail to pinpoint this.

What version and service pack is this? There is an known issue with error
3021 on Access 2002 SP3.

We may also need to know whether you BeginTrans on the dbEngine object or
the Workspace object (DAO), or if you are using ADO transactions.

With DAO, it is important not to close the default workspace. Example of
this and related issues at:
http://allenbrowne.com/ser-37.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter" <(E-Mail Removed)> wrote in message
news:400CA913-EB4E-4D3A-8BF0-(E-Mail Removed)...
> I am doing several tables update and I am using Begin and Commit Trans

method. After the CommitTrans, I try to requery one of the tables (table3),
I can get all expected records. But if I try to open it, I get runtime
error "3021" saying "Either BOF or EOF is true, or the current record has
been deleted. Requested operation requires a current record."
>
> Can anyone help me to understand this?
>
> Thanks



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      30th Jun 2004
Hi Peter.

I don't use ADO, but you opened rst1 inside the transaction, so try closing
it, setting it to Nothing, then committing, then opening it again.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Peter" <(E-Mail Removed)> wrote in message
news:C96E7C3A-74EE-4165-9D84-(E-Mail Removed)...
> I am using Access 2002 SP3. I am using ADO. My code looks like the

below.
>
> Dim cnn1 as New ADODB.Connection
> Dim rst1 as New ADODB.Recordsets
>
> Set cnn1 = CurrentProject.Connection
> Set rst1 = New ADODB.Recordsets
>
> cnn1.BeginTrans
>
> rst1.Open "Select * From tblTable" .....
>
> <logic lines here>
>
> rst1.Update
>
> cnn1.CommitTrans
>
> rst1.Open "Select * From tblTable" ..... (runtime error 3021 popup here)
>
>
> rst1.Close
> cnn1.Close
> Set rst1 = Nothing
> Set cnn1 = Nothing
>
>
>
>
>
>
>
> "Allen Browne" wrote:
>
> > We might need a bit more detail to pinpoint this.
> >
> > What version and service pack is this? There is an known issue with

error
> > 3021 on Access 2002 SP3.
> >
> > We may also need to know whether you BeginTrans on the dbEngine object

or
> > the Workspace object (DAO), or if you are using ADO transactions.
> >
> > With DAO, it is important not to close the default workspace. Example of
> > this and related issues at:
> > http://allenbrowne.com/ser-37.html
> >
> > --
> > Allen Browne - Microsoft MVP. Perth, Western Australia.
> > Tips for Access users - http://allenbrowne.com/tips.html
> > Reply to group, rather than allenbrowne at mvps dot org.
> >
> > "Peter" <(E-Mail Removed)> wrote in message
> > news:400CA913-EB4E-4D3A-8BF0-(E-Mail Removed)...
> > > I am doing several tables update and I am using Begin and Commit Trans

> > method. After the CommitTrans, I try to requery one of the tables

(table3),
> > I can get all expected records. But if I try to open it, I get runtime
> > error "3021" saying "Either BOF or EOF is true, or the current record

has
> > been deleted. Requested operation requires a current record."
> > >
> > > Can anyone help me to understand this?
> > >
> > > Thanks



 
Reply With Quote
 
=?Utf-8?B?UGV0ZXI=?=
Guest
Posts: n/a
 
      30th Jun 2004
I did try closing rst1 after transaction commit. I will try your way. I am using rst2 to open it again.

Allen, do you know any books or reference talking deeply inside ADO?

Thanks

"Allen Browne" wrote:

> Hi Peter.
>
> I don't use ADO, but you opened rst1 inside the transaction, so try closing
> it, setting it to Nothing, then committing, then opening it again.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Peter" <(E-Mail Removed)> wrote in message
> news:C96E7C3A-74EE-4165-9D84-(E-Mail Removed)...
> > I am using Access 2002 SP3. I am using ADO. My code looks like the

> below.
> >
> > Dim cnn1 as New ADODB.Connection
> > Dim rst1 as New ADODB.Recordsets
> >
> > Set cnn1 = CurrentProject.Connection
> > Set rst1 = New ADODB.Recordsets
> >
> > cnn1.BeginTrans
> >
> > rst1.Open "Select * From tblTable" .....
> >
> > <logic lines here>
> >
> > rst1.Update
> >
> > cnn1.CommitTrans
> >
> > rst1.Open "Select * From tblTable" ..... (runtime error 3021 popup here)
> >
> >
> > rst1.Close
> > cnn1.Close
> > Set rst1 = Nothing
> > Set cnn1 = Nothing
> >
> >
> >
> >
> >
> >
> >
> > "Allen Browne" wrote:
> >
> > > We might need a bit more detail to pinpoint this.
> > >
> > > What version and service pack is this? There is an known issue with

> error
> > > 3021 on Access 2002 SP3.
> > >
> > > We may also need to know whether you BeginTrans on the dbEngine object

> or
> > > the Workspace object (DAO), or if you are using ADO transactions.
> > >
> > > With DAO, it is important not to close the default workspace. Example of
> > > this and related issues at:
> > > http://allenbrowne.com/ser-37.html
> > >
> > > --
> > > Allen Browne - Microsoft MVP. Perth, Western Australia.
> > > Tips for Access users - http://allenbrowne.com/tips.html
> > > Reply to group, rather than allenbrowne at mvps dot org.
> > >
> > > "Peter" <(E-Mail Removed)> wrote in message
> > > news:400CA913-EB4E-4D3A-8BF0-(E-Mail Removed)...
> > > > I am doing several tables update and I am using Begin and Commit Trans
> > > method. After the CommitTrans, I try to requery one of the tables

> (table3),
> > > I can get all expected records. But if I try to open it, I get runtime
> > > error "3021" saying "Either BOF or EOF is true, or the current record

> has
> > > been deleted. Requested operation requires a current record."
> > > >
> > > > Can anyone help me to understand this?
> > > >
> > > > Thanks

>
>
>

 
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
BeginTrans/CommitTrans in form with subforms Dale Fye Microsoft Access 2 9th Feb 2009 11:37 PM
BeginTrans CommitTrans Rollback JKlein Microsoft Access Form Coding 1 5th Mar 2006 09:39 AM
CommitTrans in Forms =?Utf-8?B?SGVyYg==?= Microsoft Access ADP SQL Server 3 28th Jan 2006 12:56 AM
BeginTrans, CommitTrans and RollBack Tony Wainwright Microsoft Access Form Coding 1 26th Feb 2005 02:08 PM
BeginTrans, CommitTrans, & RollbackTrans =?Utf-8?B?U2hlbGRvbg==?= Microsoft Access Form Coding 1 23rd Jan 2004 09:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:43 PM.