Did I reach a limit on concurrent recordset connections?

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
%>
mikekujawaAsked:
Who is Participating?
 
ee_ai_constructConnect With a Mentor Commented:
Closed, 125 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0
 
kmorris1186Commented:
This should affect it, but try destroying the record set when done with it...

Afte the "rs.close" add a "Set rs = Nothing"
0
 
mikekujawaAuthor Commented:
Tried that and terminated the connections as each routine was finished with same results. :-(
0
 
mikekujawaAuthor Commented:
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
All Courses

From novice to tech pro — start learning today.