Solved

catastrophic failure - ADO

Posted on 2003-11-06
6
1,214 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
6 Comments
 
LVL 1

Expert Comment

by:KeyPakt
Comment Utility
What kind of database provider do you use?
0
 

Expert Comment

by:VBM2
Comment Utility
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
Comment Utility
You are trying to scroll through a record for which a transaction was committed.. Guess thats wrong...
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:jatinderbahl
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now