?
Solved

catastrophic failure - ADO

Posted on 2003-11-06
6
Medium Priority
?
1,240 Views
Last Modified: 2007-12-19
Hi


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

cn.Connect.BeginTrans

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

cn.Connect.CommitTrans


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


ClassMaster_rs.MoveNext

'''' 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

Thxs
0
Comment
Question by:jatinderbahl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:KeyPakt
ID: 9699836
What kind of database provider do you use?
0
 

Expert Comment

by:VBM2
ID: 9700121
Dear jatinderbahl,

Have you tried using a loop?

For example:

While Not ClassMaster_rs.EOF

    'what ever you want to happen
    ClassMaster_rs.MoveNext

Wend

VBM
0
 
LVL 1

Expert Comment

by:Crazy_king_in
ID: 9700166
You are trying to scroll through a record for which a transaction was committed.. Guess thats wrong...
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:jatinderbahl
ID: 9700407
hi

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.
0
 
LVL 1

Accepted Solution

by:
KeyPakt earned 150 total points
ID: 9700577
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.
0
 
LVL 9

Expert Comment

by:dancebert
ID: 9701758
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.

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question