Там в опциях флажок есть AFAIR ExecuteNoResultИли если надо результат, то INSERT INTO. OUTPUT . и Open вместо ExecuteSQLо вреде TADOQuery столько писалось.
Спасибо за совет, но к сожалению, мне дали задание реализовать ХП через ADOQuery =(
Гавриленко Сергей Алексеевич
Если ExecuteNoRecords = False, то вызов процедуры происходит, значения подставляются в таблицу, но Delphi выдаёт такое сообщение ADOQuery1: «CommandText does not return a result set».
and I get this error message:
Adoquery1: CommandText does not return a result set
Why do I get this error and how can I fix it?


3 Answers 3
Call ExecSQL to execute the SQL statement currently assigned to the SQL property. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE).
ExecSQL returns an integer value reflecting the number of rows affected by the executed SQL statement. Note: For SELECT statements, call Open instead of ExecSQL or set the Active property to true. To speed performance, an application should ordinarily prepare the query by setting the Prepared property to true before calling ExecSQL for the first time.
To insert values in table use :
To get values from table use:
You should simply remove the call to
Open is used to open the dataset returned by the query. This is also equivalent to setting ADOQuery1.Active := true . In this case, an INSERT statement does not return a dataset so there is nothing to open.
ExecSQL is used to execute statements that do not return a result dataset so that is all you need to use here.
странная проблема:
есть программа на D7, использует для выгрузки отчетов хранимые процедуры на SQL Server 2000 через ADOStoredProc.open с последющей выгрузкой рекордсета в эксель.. всё прекрасно работало много месяцев, но вдруг в один прекрасный день хранимая процедура стала говорить: ‘ CommandText does not return a result set’. и все тут. даже не выполняясь, сразу же. при этом , при запуске вручную в Query Analyzer все замечательно
ничего не менялось, ни программа, ни сами хранимки. сижу, ломаю голову, отчего это может быть и как с этим бороться?