Board index » delphi » SQL 6.5, TStoredProc - cannot create cursor handle

SQL 6.5, TStoredProc - cannot create cursor handle

Hello,

Using Delphi C/S 3.0, SQL Server 6.5

I am trying to use a cursor in a stored proc. My stored proc works just
fine when I run it through ISQL_W. Yet when I set my params and try to
set active = true, I get an error. 'Error creating cursor handle.'
Can anyone help?

 

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Hi Glen

When I have those kind of errors, then i have forgot to give the
parameters a value !!!, but it is difficult to say what Your problem
might be.

Are You using the stored proc-component ????

Quote
Glen E. Meredith wrote:

> Hello,

> Using Delphi C/S 3.0, SQL Server 6.5

> I am trying to use a cursor in a stored proc. My stored proc works just
> fine when I run it through ISQL_W. Yet when I set my params and try to
> set active = true, I get an error. 'Error creating cursor handle.'
> Can anyone help?

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Quote
abentsen wrote:

> Hi Glen

> When I have those kind of errors, then i have forgot to give the
> parameters a value !!!, but it is difficult to say what Your problem
> might be.

> Are You using the stored proc-component ????

> Glen E. Meredith wrote:

> > Hello,

> > Using Delphi C/S 3.0, SQL Server 6.5

> > I am trying to use a cursor in a stored proc. My stored proc works just
> > fine when I run it through ISQL_W. Yet when I set my params and try to
> > set active = true, I get an error. 'Error creating cursor handle.'
> > Can anyone help?

abentsen,

I am using TStoredProc component. This is all at design time. I set my
params and try to set active=true. Here's some more info.

In the storedproc I am creating a temp table(#temp). I declare my
cursor, open, fetch. I then insert into the temp table the values from
then fetch. Close the cursor, deallocate. I then select * from the temp
table as my result set. This is all in the IDE because I want to set up
my report(col spacing, etc).

-Glen

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Glen

At a guess, you're using the method calls OPEn or Active := True for a
statement which returns no dataset.  Use the ExecSQL method instead.

Derek Davidson
Get a FREE copy of DK's Audit Components for Delphi from my web site:
http://freespace.{*word*269}.net/d.davidson
Now Includes INFOPOWER Derived components and a demo

(Remove the x to EMail me : der...@mksoft.com)

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Quote
Derek Davidson wrote:

> Glen

> At a guess, you're using the method calls OPEn or Active := True for a
> statement which returns no dataset.  Use the ExecSQL method instead.

> Derek Davidson
> Get a FREE copy of DK's Audit Components for Delphi from my web site:
> http://freespace.{*word*269}.net/d.davidson
> Now Includes INFOPOWER Derived components and a demo

> (Remove the x to EMail me : der...@mksoft.com)

Derek,
I'm not sure if you saw this tidbit of info:

I am using TStoredProc component. This is all at design time. I set my
params and try to set active=true. Then the error message. Here's some
more info.

In the storedproc I am creating a temp table(#temp). I declare my
cursor, open, fetch. I then insert into the temp table the values from
then fetch. Close the cursor, deallocate. I then select * from the temp
table as my result set. This is all in the IDE because I want to set up
my report(col spacing, etc).

-Glen

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Glen

You'll need to check your documentation, but I know that there are two
types of temporary table which can be created.  One which lasts beyond
the current procedure and one which does not.  Perhaps you have the
latter and that's why Delphi can't see it.

Derek Davidson
Get a FREE copy of DK's Audit Components for Delphi from my web site:
http://freespace.{*word*269}.net/d.davidson
Now Includes INFOPOWER Derived components and a demo

(Remove the x to EMail me : der...@mksoft.com)

Re:SQL 6.5, TStoredProc - cannot create cursor handle


Quote
Glen E. Meredith wrote:

> abentsen wrote:

> > Hi Glen

> > When I have those kind of errors, then i have forgot to give the
> > parameters a value !!!, but it is difficult to say what Your problem
> > might be.

> > Are You using the stored proc-component ????

> > Glen E. Meredith wrote:

> > > Hello,

> > > Using Delphi C/S 3.0, SQL Server 6.5

> > > I am trying to use a cursor in a stored proc. My stored proc works just
> > > fine when I run it through ISQL_W. Yet when I set my params and try to
> > > set active = true, I get an error. 'Error creating cursor handle.'
> > > Can anyone help?

> abentsen,

> I am using TStoredProc component. This is all at design time. I set my
> params and try to set active=true. Here's some more info.

> In the storedproc I am creating a temp table(#temp). I declare my
> cursor, open, fetch. I then insert into the temp table the values from
> then fetch. Close the cursor, deallocate. I then select * from the temp
> table as my result set. This is all in the IDE because I want to set up
> my report(col spacing, etc).

> -Glen

--

Hi Glen
I wonder !
If Your result is one record then You must use the EXECPROC-command and
if Your result is a dataset then You have to use the Open-command !!

Regards/ med venlig hilsen

Allan Bentsen
SystemsConsultant,
Electronics Engineer (BScEE)
Homepage http://www.4d.dk
mailto:abent...@4d.dk

Other Threads