Solved

Did I reach a limit on concurrent recordset connections?

Posted on 2004-09-23
5
215 Views
Last Modified: 2006-11-17
I keeping getting the following error when I add another connection in this asp app.

Microsoft OLE DB Provider for SQL Server error '80040e21'

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

/CMANAGER/editNOTES/editNOTES.ASP, line 124

It was functioning correctly with no errors until I added another recordset connection

Here is the syntax and I for the life of me cannot figure out what is wrong. The table that is not allowing adding records is a new table but I know the field definitions are correct. The new table name is Notes.

below is the form action when data is submitted
The cs variable holds the new table connection

Other connection variables not listed below are inside the form for populating lists. SO did I reach a limited and if not what is wrong. I can't even get one record inside the new table

<%
Response.Buffer = True
Dim connStrx, rs, ss, ts, zs, ds, email1, email2, chap1, bookopt, TX

connStrx = "Provider=SQLOLEDB;UID=;PWD=;Data Source=;Initial Catalog=;"

Set ss = CreateObject("ADODB.Recordset")
Set rs = CreateObject("ADODB.Recordset")
Set ts = CreateObject("ADODB.Recordset")
Set zs = CreateObject("ADODB.Recordset")
Set ds = CreateObject("ADODB.Recordset")
Set cs = CreateObject("ADODB.Recordset")

If Request.Form("Submit")="Update" Then
 if request.form("contact") <> "Information Only" then
   ss.Open "companies where cust_id=" & request.form("cust_id1"), connStrx, 2, 2
   ss("summary_contact") = "<A NAME='" & request.form("nextdate") & "'></A><br>" & _
   "Record Appended: " & date() & "<br>" & _
   "Person Contacted: " & request.form("contact") & "<br>" & _
   "Modified by: " & request.form("sessiona") & "<br>" & _
   "Type of Contact: " & request.form("method") & "<br>" & _
   "Next Contact Method: " & request.form("method2") & "<br>" & _
   "Next Contact Scheduled for: " & request.form("nextdate") & "<br>" & _
   "Additional Notes: <br>" & _
   request.form("newtext") & "<br><br>" & _
   "*********************<br>*********************<br><br>" & _
   ss("summary_contact")
   ss("next_contact") = request.form("NextDate")
   ss("next_contact_type") = request.form("Method2")
   ss("last_contact") = date()
   ss("type_contact") = request.form("method")
   ss.Update
 else
 end if

 if request.form("contact") = "Information Only" then
   ss.Open "companies where cust_id=" & request.form("cust_id1"), connStrx, 2, 2
   ss("summary_contact") = "<br>INFORMATION ONLY UPDATE<br>" & _
   "Record Appended: " & date() & "<br>" & _
   "Modified by: " & request.form("sessiona") & "<br>" & _
   "INFORMATIONAL NOTES: <br>" & _
   request.form("newtext") & "<br><br>" & _
   "*********************<br>*********************<br><br>" & _
   ss("summary_contact")
   ss.Update
 else
 end if

   ts.open "Log", connStrx, 2, 2
   ts.AddNew
   ts("date") = date()
   ts("time") = time()
   ts("username") = request.form("sessiona")
   if request.form("contact") = "Information Only" then
   ts("type") = "INFORMATIONAL NOTE UPDATE"
   ts("details") = "System User: " & request.form("sessiona") & "<br>Date: " & date() & "<br>Time: " & time() & "<br> COMPANY :" & request.form("company") & " Informational Note Added<br>"
   else
   ts("type") = "EDIT COMPANY NOTES"
   ts("details") = "System User: " & request.form("sessiona") & "<br>Date: " & date() & "<br>Time: " & time() & "<br> COMPANY :" & request.form("company") & " Notes Modified <br>"
   end if
   ts.Update
   ts.close

   cs.open "Notes", connStrx, 2, 2
   cs.AddNew
   cs("cust_id") = request.form("cust_id1")
   cs("company") = request.form("company")
   cs("contact") = request.form("contact")
   cs("date") = date()
   cs("time") = time()
   cs("type") = request.form("method")
   cs("username") = request.form("sessiona")
   cs("details") = "<br>" & _
   "Record Created: " & date() & "<br>" & _
   "Person Contacted: " & request.form("contact") & "<br>" & _
   "Modified by: " & request.form("sessiona") & "<br>" & _
   "Type of Contact: " & request.form("method") & "<br>" & _
   "Next Contact Method: " & request.form("method2") & "<br>" & _
   "Next Contact Scheduled for: " & request.form("nextdate") & "<br>" & _
   "Additional Notes: <br>" & _
   request.form("newtext") & "<br><br>" & _
   "*********************<br>*********************<br><br>" & _
   cs.Update
   cs.close
   
   response.write "Notes have been updated<br>Email sent to : " & request.form("email1") & "<br><a href='javascript:window.close()'>Close this Window</a>"
   email1= request.form("email1")
   if len(rtrim(email1))>1 then
    ds.open"users where rtrim(name)='" & request.form("sessiona") & "'", connstrx, 3, 4
    Dim objMail
    Set objMail = Server.CreateObject("CDONTS.NewMail")
    objMail.From = ds("email")
    objMail.Subject = "Company Notes and Schedule has been modified"
    objMail.To = request.form("email1")
    objMail.CC = ds("email")
    objMail.BodyFormat=0
    objMail.MailFormat=0
    if request.form("contact") = "Information Only" then
    objMail.Body = "<p>" & _
    "<P>" &_
    " The following INFORMATIONAL Notes have been added and sent to you by: " & ds("name") & "<br>" & _
    "Please login to the <a href='http://www.simeusfoods.net/cmanager/cmanager.asp' title='Click here to Login'>Simeus Foods Contact Manager Website</a> for further details<br><br>" & _
    "Record Appended: " & date() & "<br>" & _
    "Company Name: " & request.form("company") & "<br>" & _
    "INFORMATIONAL NOTE: <br>" & _
    request.form("newtext") & "<br><br>" & _
    "*********************<br>*********************<br><br>"
    else
    objMail.Body = "<p>" & _
    "<P>" &_
    " The following Notes have been added and sent to you by: " & ds("name") & "<br>" & _
    "Please login to the <a href='http://www.simeusfoods.net/cmanager/cmanager.asp' title='Click here to Login'>Simeus Foods Contact Manager Website</a> for further details<br><br>" & _
    "Record Appended: " & date() & "<br>" & _
    "Company Name: " & request.form("company") & "<br>" & _
    "Contact Name: " & request.form("contact") & "<br>" & _
    "Person Contacted: " & request.form("contact") & "<br>" & _
    "Modified by: " & request.form("sessiona") & "<br>" & _
    "Type of Contact: " & request.form("method") & "<br>" & _
    "Next Contact Method: " & request.form("method2") & "<br>" & _
    "Next Contact Scheduled for: " & request.form("nextdate") & "<br>" & _
    "Additional Notes: <br>" & _
    request.form("newtext") & "<br><br>" & _
    "*********************<br>*********************<br><br>"
    end if
    objMail.Send
    Set objMail = nothing
   else
   end if
   
else
%>
0
Comment
Question by:mikekujawa
  • 2
5 Comments
 
LVL 7

Expert Comment

by:kmorris1186
Comment Utility
This should affect it, but try destroying the record set when done with it...

Afte the "rs.close" add a "Set rs = Nothing"
0
 

Author Comment

by:mikekujawa
Comment Utility
Tried that and terminated the connections as each routine was finished with same results. :-(
0
 

Author Comment

by:mikekujawa
Comment Utility
I found the problem.
Seems I called out the memo field wrong
had to be ntext 16 instead of text 16

Thank you for your help anyways
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
Comment Utility
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

12 Experts available now in Live!

Get 1:1 Help Now