Solved

catastrophic failure - ADO

Posted on 2003-11-06
6
1,218 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
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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

786 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