Command text was not set for the command object

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
John Bell

Command text was not set for the command object

Post by John Bell » Wed 31 May 2006 18:09

If I run the following in Query Analyzer

Insert into W2KServer.TQGLaptop.dbo.IdPhEm
Select top 1000 * from W2KServer.TQGData.dbo.IdPhEm

it works. if i run it in TMSQuery, I get

Command text was not set for the command object

What am I doing wrong?

I am using Delphi 2005 E and SDAC 3.70.0.24 and I just
noticed the about screen says for Delphi 2006!

Jackson
Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Thu 01 Jun 2006 08:29

Do you call Prepare method before executing this query?
Do you set non-default value to TMSQuery.CommandTimeout property?

John Bell

Command text was not set for the command object

Post by John Bell » Thu 01 Jun 2006 14:38

does the same thing whether or not i call prepare. timeout is zero.
error shows up immediately upon execution. would it have something
to do with accessing two databases at the same time (as what i need
to do eventually is access two different servers at the same time).
thanks.

John Bell

Command text was not set for the command object

Post by John Bell » Thu 01 Jun 2006 15:08

Please ignore all -- it was, once again , me being stupid.
that query was working fine but the following one was trying
to execute a "blank query". thanks.

Post Reply