Back

AKH Online, Inc

Home

SQL Error: Could not find prepared statement with handle...

When setting up, configuring or programming a SQL Server database against a ColdFusion datasource, you may encounter this error:

 

Could not find prepared statement with handle x

 

Where x is a number.

By my novice research, this could mean that the SQL server is confused by the use of some cached query plan - to poll a database table that has been changed. The change could be the removal of a column or object referred to in the plan (by "handle"), possibly via some administrative or outside process.

Using the advice in this thread, I did the following with success:

  1. Opened the datasource settings in ColdFusion Administrator
  2. Clicked the "Advanced" button
  3. Set "Max Pooled Statements" to zero (after noting the number currently there)
  4. Unchecked "Maintain Connections"
  5. Click "Submit"
  6. Repeat the same steps above, this time setting things back to where they were before.
  7. Restart your ColdFusion application if needed.

Perhaps the alteration of the datasource by any measure caused the fix, or these steps are a red herring - the cached query just expired on its own. If and when I encounter this issue again, I'll try other some stuff and let you know.

Full Version