Run-time error ‘3704’ Operation is not allowed when the object is closed

Run-time error ‘3704’ Operation is not allowed when the object is closed.


To resolve the error, ensure the code you execute returns only data as a result, and not the intermediary “rows affected” messages. To achieve this, the following line to your stored procedure / code.



Sample Error Message

Add “SET NOCOUNT ON;” to your stored procedure.

I have identified several blog posts where people experienced the same problem

Run-Time Error 3704 Operation Is Not Allowed The Object Is Closed


ADO error “3704” object is closed


The SQL Server OLEDB provider (SQLOLEDB) has a new behavior designed to provide more accurate information to the caller about what happened in the procedure. Each SQL statement within a stored procedure returns a “result,” either a count of rows affected, or a resultset.

The SQL Server ODBC provider (MSDASQL) does not provide information about the results of individual SQL statements within a stored procedure. The only result that comes back from a stored procedure execution is the result of the SELECT statement if it has one. This is why the problem does not manifest with MSDASQL.


To get SQLOLEDB to behave as the SQL ODBC driver did, you must use SET NOCOUNT ON. Put SET NOCOUNT ON in the stored procedure or in the SQL statement used with ADO as shown in the code sample below. Alternatively, you could use MSDASQL.


This behavior is by design.

The problem is described here:





Event Id: 10016 – The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {000C101C-0000-0000-C000-000000000046}

I saw my windows event logs flooded with Event Id: 10016 as seen below.

The message was cryptic, and the errors repeated every 5 minutes.


Error Message

The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {000C101C-0000-0000-C000-000000000046}
to the user NT AUTHORITY\LOCAL SERVICE SID (S-1-5-19) from address LocalHost (Using LRPC). This security permission can be modified using the Component Services administrative tool.

Steps To Resolve Issue:

  1. Open Component Services (Be Sure to “Run as Administrator”)
  2. Navigate to Component Services –> Computers –> My Computer –> DCOM Config –> {000C101C-0000-0000-C000-000000000046}
  3. Go to Security Tab and Add Rights for the Local Service Account
  4. Confirm that Error no longer occurs / floods event logs

Access violation at address 01B54D5C in module ‘NPrinting.exe’. Read of address 00000000

The service account for NPrint does not have access to the QVW you are attempting to load. Grant Access to the document.

This can be via Section Access Management or by making the User a member of the “QlikView Administrators” or “QlikView Document Administrator” group and re-publish the document.

Please note that if you create a new service account and change the Service Account for NPrintingService and experience the above error message. NPrinting will not function correctly until documents are republished. Republished documents will have the required rights to access the documents.


We also had this problem after logging out of the session and windows and then logging back into the computer permissions were restored. Curious if a windows session can be corrupted leading to incorrect permissions / errors when loading documents.

run_duration to seconds #sqlserver sysjobhistory

Sample code showing how to convert the run_duration column from msdb.dbo.sysjobhistory to seconds.

, as job_name
, s.step_name
, s.step_id
-- , s.command
,dbo.agent_datetime(run_date, 0) as step_start_date
,dbo.agent_datetime(run_date, run_time) as step_start_date_time
,run_duration/10000 as run_duration_hours_only --hours
,run_duration/100%100 as run_duration_minutes_only --minutes
,run_duration%100 as run_duration_seconds_only --seconds
,(run_duration/10000 * 60 * 60) + -- hours as seconds
(run_duration/100%100 * 60) + --minutes as seconds
(run_duration%100 ) as run_duration_total_seconds --seconds
-- , h.*
from msdb.dbo.sysjobs j inner join
msdb.dbo.sysjobsteps s on j.job_id = s.job_id inner join
msdb.dbo.sysjobhistory h on s.job_id = h.job_id and s.step_id = h.step_id
and like 'syspolicy_purge_history'
order by h.instance_id desc

Installing LogMeIn Hamachi for Linux (Beta) command line version on Ubuntu 16.04 LTS

I have used Hamachi for years, and while it does not seem to be heavily marketed, if you are an IT Pro, I do not know how you live with out this software.

I recently configured a server with Ubuntu 16.04 LTS, and wanted to have remote access to my server from my mobile phone / other computers while on the phone.

When I tried to install LogMeIn Hamachi for Linux (Beta) on Ubuntu 16.04 LTS. The installation failed. As lsb-core was not available. The documentation on Hamachi clearly states that lsb 3.0 or greater is required.

LogMeIn Hamachi for Linux (Beta)

Please make sure you have the LSB 3.0 (or above) package installed prior to attempt installing the product. If you had an older version of Hamachi for Linux, please make sure you uninstall it prior to attempt installing the latest software and read the README file located in the download package. Make sure that you have an ARMv4T or better processor and tun/tap driver installed before running Hamachi for Linux with ARM support.

Do the following to install the LogMeIn Hamachi Client.

# The following are a list of commands you are run to install Hamachi in one step
# go to downloads folder
cd ~/Downloads
# download hamachi client (64 bit)
# download hamachi client (32 bit)
# install lsb from Ubuntu 14.04
#  Out of desperation I've downloaded and installed the lsb-core package for Ubuntu 14.04,
sudo add-apt-repository "deb trusty main" && sudo apt-get update && sudo apt-get install lsb-core -y
# install hamachi client
dpkg -i ./logmein-hamachi_2.1.0.139-1_amd64.deb
# join network
hamachi do-join 000-000-000

Update the last line of code with your appropriate network id before running this.

Then go to your LogMeIn Central and approve the network join request.

**It Worked** Connected to Linux Server from My iPhone 6 Plus 


Happy Computing.

The two apps I tested this with are:

Server Auditor

Reflection for UNIX – SSH Client


SQL Server Error: 9001, Severity: 21, State: 5 – The log for database `database_name` is not available. Check the event log for related error messages. Resolve any errors and restart the database. | Error: 9001, Severity: 21, State: 5. | Matched: %Error%,

Upon being greeted with the following logs, I started investigating the issue.

I found the issue to be caused by the database being closed, and not any major underlying disk issue.

Check if your database has auto_close enabled.

select @@SERVERNAME AS server_name,getutcdate() as report_date_utc,name as database_name, is_auto_close_on , state_desc, user_access_desc
from sys.databases
where is_auto_close_on = 1
order by name asc

If autoclose is on, switch this database to no longer use auto_close.

Before making any changes, check the integrity of the database. If there are no errors generated by this command, then  move on to changing the auto_close option.

dbcc checkdb('database_name')

alter database [database_name] set offline with rollback immediate;
alter database [database_name] set online;

alter database [database_name] set AUTO_CLOSE OFF;

NoSQL company Basho loses CEO and CTO


Basho, a NoSQL startup whose Riak database competes against the likes of Cassandra in scale-out environments, has lost its CEO Greg Collins, CTO Justin Sheehy and Chief Architect Andy Gross. In an interview with the Register, Sheehy said the departures aren’t as bad as they look and that the company is in good hands. Perhaps, although whoever replaces Collins will be the company’s fourth CEO since it was founded in 2007, and neither of the company’s co-founders remain. Basho has raised more than $31 million in venture capital, with its last funding round of $11.1 million coming in July 2012.

View original post