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

As I was maintaining some old ASP code for a client, we ran across the error below while migrating to a new site

Microsoft OLE DB Provider for ODBC Drivers error ‘80040e23′
Row handle referred to a deleted row or a row marked for deletion.

classes.asp, line 346

Quite a cryptic message I think! The line in question was a simple select statement.
Line 346 was the objRS.open dim strSQL strSQL = “SELECT * FROM Classes INNER JOIN ClassBooks ON Classes.ClassID=ClassBooks.Class_ID" objRS.open strSQL, objConn

Strange message considering we aren’t running a delete or update command anywhere.

After looking around the database, I realized that the ClassBooks table should have had the two FK fields in it (ClassID, BookID) setup as primary keys in the table. There were also a few records with a null BookID. After removing the null records and setting up the primary keys everything was fixed!

POSTED BY Divergence Hosting on Mar 11 under ASP, SQL

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

Copyright Divergence Hosting Technical Blog | Powered by WordPress | Using the GreenTech Theme

SEO Powered by Platinum SEO from Techblissonline