MSSQL: "Connection is busy with results for another hstmt (S1000)" on random tables

Applies to: Clarion 6.1 (build 9032) Enterprise with the MSSQL driver against SQL Server 2000 as reported; the PROP:BusyHandling property exists in every later version.

Problem

Browses and forms occasionally fail with Error: (Connection is busy with results for another hstmt(S1000) attempting to access a record from the dbo.xxxxx file. Returning to previous window. It happens with any of the 60+ tables, with 5 rows or hundreds of thousands. The poster had tried the four BUSYHANDLING values in the driver string without success.

Solution

  1. The error appears when two threads use the same MSSQL connection at once. PROP:BusyHandling tells the driver how to deal with that; the help lists its options.
  2. Set the property BEFORE the first connection is made, that is before the first table is opened. The Program Startup embed or the frame's "before opening files" embed are the places.
  3. Set it on the very first file the application opens. The poster first set it on a user table that was opened first by the user, and it did not take; set on the security file (the first one the application itself opens) it worked. The documentation quoted in the thread: "This setting is system wide, so once you set it (regardless of which table) it is set for all tables on all threads."
  4. The value that worked for the poster was BUSYHANDLING = 2.

Caveats

  • Setting the value in the dictionary's driver string on the first user table did not work for the poster; the thread did not settle why the property form worked and the driver-string form did not.
  • The poster reported "seems to work properly" in development and planned a production test; the thread holds no follow-up.

Today (2026)

PROP:BusyHandling is still the switch for shared connections on the MSSQL driver and the "before the first OPEN" rule still applies. Not re-tested on a current build.

Sources: Michael M. (Apr 2005, the question), Jim K., Shankar (Apr 2005) in softvelocity.clarion.databasedrivers.