Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

catastrophic failure - ADO

Posted on 2003-11-06
6
Medium Priority
?
1,244 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

636 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