catastrophic failure - ADO


ClassMaster_rs.Open "SELECT * FROM ClassMaster", cn.Connect, adOpenDynamic, adLockOptimistic


With ClassMaster_rs
   If m_AddMode = mAddNew Then
      m_ClassID = cn.GetMaxCode("ClassMaster", "ClassID")
      !ClassID = m_ClassID
   End If
   !Class = t_Class
End With


''''' After this when i execute following code it raises the run time error


'''' it raises the run time error

Run-time error '-2147418113(8000ffff)':

catastrophic failure

if i remove the cn.Connect.BeginTrans and cn.Connect.CommitTrans it run ok.

What is wrong with the code

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

What kind of database provider do you use?
Dear jatinderbahl,

Have you tried using a loop?

For example:

While Not ClassMaster_rs.EOF

    'what ever you want to happen


You are trying to scroll through a record for which a transaction was committed.. Guess thats wrong...
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

jatinderbahlAuthor Commented:

recordset is common for both purpose i.e while on Update and Movenext.

  i am using sql server as back end. still not getting where the problem is.
Have you tested to execute ClassMaster_rs.Requery before you execute ClassMaster_rs.MoveNext? I suggest you test this because it looks like the recordset looses it's handle when you commit your transactions.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KnowledgeBase article Q180843 might apply.  Scroll down to the last paragraph before the STATUS heading:

>NOTE: If you refer to either recordset after the transaction has been
>committed or aborted, you see the following error:

>Run-time error '-2147418113': Catastrophic failure

This error is discussed in the context of opening multiple recordsets.  You're only opening one, but maybe the solutions offered will work for you.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.