Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2219
  • Last Modified:

Urgent: Cannot create new connection because in manual or distributed transaction mode.

Urgent: 100 more Points will be added if the problems can be solved.

Error occur when execute the following ASP program:

Cannot create new connection because in manual or distributed transaction mode.

Set cn1 = Server.CreateObject("ADODB.Connection") ....
for i= 1 to x

response.write empDesc

cn1.execute "insert table1...."
cn1.execute "update table3"


Function FindIdDescription(tmpCode,tmpcn1)
  Dim rstemp

    set rstemp = server.CreateObject("adodb.recordset")
    sqlstm ="select * from table2 " sqlstm ,tmpcn1
    If not rstemp.eof then
       FindDescription = rstemp("Desc")
       FindDescription = "N"
    End If
    set rstemp=nothing

End Function

How to solve this problem?
1 Solution
Anthony PerkinsCommented:
Urgent:  Please maintain your open questions:
Query cannot be updated Date: 11/29/2000 01:35AM PST
ASP command change to  Java Command Date: 06/06/2001 03:09AM PST
Zip a file in Active Server Pages Date: 01/30/2001 02:01AM PST
How can I set the page never timeout expired? Date: 11/30/2000 08:06PM PST


Brendt HessSenior DBACommented:
I have a feeling that you oversimplified your ASP code here.  There is a known issue with this type of code, but only if there is an open rs with pending actions when you try to open another rs.

This error only occurs if you use the default Firehose cursor.  You can prevent it by setting something other than a read-only, forward-only cursor on the rsTemp open.
Anthony PerkinsCommented:
Take a look at this article from MSDN:
PRB: SQLOLEDB Allows Only One Connection in Scope of Transaction;EN-US;Q272358&

Thank you for maintaining your open questions,
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

If you have a connection already made make sure you close it and set it to nothing before trying to open a new connection.  Just a thought.  I know I've had problems in the past similiar to this one.
leo_wh_cheungAuthor Commented:

I solve this problem by the following method:

1. Define(Dim) a local variable in the function. Otherwise, other function can use this variable and error may occur.

2. Create another connection to update the recordset

3. make sure you close it and set it to nothing before trying to open a new connection.


Not a problem.  Glad you got it fixed.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now