Board index » delphi » Error creating cursor handle

Error creating cursor handle

 get the following message when call Tquery.sql.open:

Project TestP1dpr.exe raised exception class ENoResultSet
with message 'Error creating cursor handle'.
Process stopped.

Use Step or Run to continue

The following code uses ParamByName to assign the text
of 4 editbox to the fn,usnt..  parameters,
-----------------------------
with qry do
   begin
      close;
      sql.clear;
      sql.add('exec update_voyage_dollar :fn,:usnt,:dollar,:dollarnt');
      parambyname('fn').asstring:=edtfn.Text;
      parambyname('usnt').asstring:=medtvoyusnt.text;
      parambyname('dollar').asstring:=medtvoydollarnt.text;
      parambyname('dollarnt').asstring:=medtvoydollarnt.text;
      open;
end;

the stored procedure code below:
-----------------------------------------
CREATE PROCEDURE update_voyage_dollar
                @fn varchar(10),
                @usnt decimal,
        @dollar varchar(3),
        @dollarnt decimal

AS
update voyage set usnt=@usnt,dollar=@dollar,dollarnt=@dollarnt
where fn=@fn
GO

--
 [m [1;31m? ?:?Ei??aoo? bbs.yeskw.com?E[FROM: dns.hiperfect.com] [m

 

Re:Error creating cursor handle


"cocl" <yeskw....@bbs.yeskw.com> skrev i melding
news:3ehTfS$tHE@bbs.yeskw.com...

Quote
> get the following message when call Tquery.sql.open:

> Project TestP1dpr.exe raised exception class ENoResultSet
> with message 'Error creating cursor handle'.
> Process stopped.

> Use Step or Run to continue

> The following code uses ParamByName to assign the text
> of 4 editbox to the fn,usnt..  parameters,
> -----------------------------
> with qry do
>    begin
>       close;
>       sql.clear;
>       sql.add('exec update_voyage_dollar :fn,:usnt,:dollar,:dollarnt');
>       parambyname('fn').asstring:=edtfn.Text;
>       parambyname('usnt').asstring:=medtvoyusnt.text;
>       parambyname('dollar').asstring:=medtvoydollarnt.text;
>       parambyname('dollarnt').asstring:=medtvoydollarnt.text;
>       open;

Try ExecSQL; instead of Open;
Open is meant for sql statements that produce a result set (Selects from
tables, functions, etc.), while ExecSQL (used with updates, deletes, Inserts,
etc.) does not produce a dataset.

--
Bjoerge Saether
Consultant / Developer
http://www.itte.no
Asker, Norway
bjorgeremovet...@itte.no (remove the obvious)

Other Threads