This project has moved. For the latest updates, please go here.

Command text was not set for the command object.

Mar 15 at 8:37 AM
Edited Mar 15 at 5:06 PM
I have successfully installed your COM wrapper on my development environment (Win7 64-bit with SSMS installed locally) which is working fine. I have attempted to do the same on our internal testing environment but it is throwing some ADO errors.

Wed Mar 15 08-17-16 2017
Error : -2147217908
ErrorMessage : IDispatch error #3084
Source : Microsoft SQL Server Native Client 10.0
Description : Command text was not set for the command object.
Wed Mar 15 16-54-05 2017
ADO Error: Command text was not set for the command object.
Query: 
The test environment is Windows Server 2012 64-bit but does not have SQL Server installed as this is on a separate server.

I had to install the SQL Server Native Client as this was not present on our Test machine, and have also tried "Microsoft OLE DB Provider for SQL Server" which was present, however both throw the same "Command text was not set for the command object" error.

Is there some other element of SQL Server that needs to be installed that is on my development machine but not the test environment because we have a separate server for SQL Server? Have you attempted to run your COM wrapper on a server which does not have SQL Server installed?
Coordinator
Mar 16 at 8:40 AM
Hello,

Yes, Homelidays used to have separated hosts for SQL servers and web servers.

Let me dig into the web host installation script to see if I can find some more useful information for you.

Yanal
Coordinator
Mar 16 at 8:53 AM
Hello,

So Homelidays was running on Windows Server 2008 R2 and was installing the following SQL server components on the web hosts:
  • SqlNativeClient 10.50.1600
  • SqlSysClrTypes 0.50.1600
Actually I don't believe Session Service requires SqlSysClrTypes but only the SqlNativeClient.I am wondering if you will get the same issue if you install the same version of SqlNativeClient (so 10.50.1600)?

I don't know if that also can help: When you install Session Service, you should also use Setup.exe (not Setup.msi). The first will install if needed the Visual C++ 2008 Redistribuable (KB2467174) before installing the Setup.msi

Yanal
Coordinator
Mar 16 at 9:51 AM
Hello,

I was able to reproduce your error :-)
Thu Mar 16 10-41-53 2017
    Error : -2147217908
    ErrorMessage : IDispatch error #3084
    Source : Microsoft SQL Server Native Client 11.0
    Description : Command text was not set for the command object.
I suspect you didn't install session service on the test server using the installer (setup.exe) provided.

The Session Service needs the Createtables.sql file to be in the same folder as the dlls.
This files contains the SQL commands to create the session table if it does not yet exist.

I can help explaining why this file is needed and why it's also possible to not give create table authorization to your app, if you need some more détails.

Could you let me know if that file was missing and if adding it fixed your issue please?
Marked as answer by Yanal on 3/16/2017 at 1:35 PM
Mar 16 at 11:43 AM
I am pretty sure I picked the EXE file and not MSI. However, I reinstalled with admin rights to be sure.

I had manually created the table by running the Createtable.sql script as would have preferred not to give CREATE TABLE access. However, I made the user a db_owner, loaded the site and it worked. Following this, I removed the db_owner membership and reloaded the site and it continued to work!

The site now appears to be working, fantastic. Thank you