Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7978451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:29:44+00:00 2026-06-04T09:29:44+00:00

We have an old site that is giving us an error. It uses VBScript

  • 0

We have an old site that is giving us an error. It uses VBScript and the DB is SQL Server 2005.

Here is the code:

set oNotes = server.CreateObject("SCRIPTING.DICTIONARY")

openSQL "SELECT * FROM v_client_notes WHERE contact_id = " &_
    my_contactID & " ORDER BY client_notes_duedate ASC"

do while rs.eof = false
    set temp = server.CreateObject("SCRIPTING.DICTIONARY")
    load_rs temp, rs
    set oNotes(trim(rs("client_notes_id"))) = temp
    rs.movenext'error on this line
loop

Error:

Microsoft OLE DB Provider for SQL Server error ‘80040e23’

Row handle referred to a deleted row or a row marked for deletion.

This error does not happen all the time, just for record sets returned with certain contact_id’s. Haven’t been able to pinpoint the difference in the ones that work and the ones that don’t.

As you can see the error happens on rs.movenext.

I have made sure that the table has a primary key (client_notes_id).

Thank you for your help!

EDIT

Here is the code for load_rs:

function load_rs(dict,Byref record)
    for each thing_record in record.fields
        dict(thing_record.name) = trim(thing_record.value)
    next
end function

Here is the update script. This is on a separate page that I post to (kinda AJAX style):

If request("client_notes") <> "" then
        client_notes_subject = request("client_notes_subject")
        client_notes_postedby = session("user") 
        client_notes_duedate = request("client_notes_duedate")
        if client_notes_duedate = "" then
            client_notes_duedate = NULL
        end if
        client_notes_date_entered = request("client_notes_date_entered")
        client_notes =  request("client_notes")
        if isnumeric(request("contactID")) then contact_id = request("contactID")
        if clientnotes_id="" then clientnotes_id="0"
        openSQL("SELECT * FROM client_notes WHERE client_notes_id=" & clientnotes_id)
        if rs.EOF then
            openSQL("SELECT newid()")
            client_notes_guid = rs(0)
            openSQL("select * from client_notes")
            rs.addnew
        else
            client_notes_guid = rs("guid")
            rs.update
        end if 

        rs("contact_id") = contact_id   
        rs("client_notes_subject") = client_notes_subject
        rs("client_notes_postedby") = session("user")
        'if client_notes_duedate <> Null then
        rs("client_notes_duedate") = client_notes_duedate 
        'end if
        rs("client_notes_date_entered") = client_notes_date_entered
        rs("client_notes") = client_notes
        rs("guid")=client_notes_guid
        rs.update

        'if client_notes_duedate = Null then 
        '   sqlSetNullnotes = "UPDATE client_notes SET client_notes_duedate = NULL WHERE client_notes_id=" & clientnotes_id
        '   opensql sqlSetNullnotes
        'end if

        next_due_date = request("next_due_date")
        if next_due_date = "" then
            next_due_date = NULL
        end if

        openSQL("SELECT * FROM " & MainContactsDB & " WHERE Contact_ID=" & contactID)
        rs("Last_Contact_Date") = client_notes_date_entered
        rs("Next_Contact_Date") = next_due_date
        rs.update
    end if

openSQL method:

Set rs = Server.CreateObject("ADODB.Recordset")
function openSQL(SQLrs)
    if rs.state = 1 then rs.close
    'response.write sqlRS
    rs.Open SQLrs, conn, 3, 3
end function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:29:45+00:00Added an answer on June 4, 2026 at 9:29 am

    Ok I was able to solve this.

    I am running the query against a view which joins 2 tables.

    The problem was that sometimes a note was submitted without the user id so the join from one table to the other didn’t work cause user id was null. I modified my query to the following:

    "SELECT * FROM v_client_notes WHERE contact_id = " & my_contactID & " AND user_id IS NOT NULL ORDER BY client_notes_duedate ASC"
    

    Now the error doesn’t come back, it just excludes the notes that aren’t assigned to someone. So now on to fixing why the note wasn’t assigned to someone.

    Thanks!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have old code that uses size_t which IIRC comes from cstring.h. On OS
I have an old SQL Server 2000 database that I want to get into
I have an old site that uses xml documents, and when I created it
I have got an old site that has recently been displaying an error which
I have an old .net 2005 web site that has some asp pages and
I have looked but can't find anything that works. I have an old site
My partner and I have a webcam site that basically runs the old-school method....Every
I have an old osCommerce site that was PHP4, now running on PHP5. Named
I have an old drupal site that I'd like to upgrade, but I need
I have an old school ASP (note: not ASP.NET) web site that has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.