Subject | Re: [ib-support] Declare Cursor Already Exists??? HELP!!! |
---|---|
Author | Jason Wharton |
Post date | 2001-01-17T08:45:33Z |
I know while developing IBO that cursor names can be a bit of a chore to
work with. The worst cases to deal with were the consequences that didn't
result in error messages but instead incorrect select statements. If two
users use the same cursor name they can get their results mixed up. No
kidding!
I ended up including cursor names in my SQL trace output just so that I
could keep tabs on them. InterBase will deal with cursors correctly if the
API is used correctly. I would suggest that you try and see if IBX will
output the names of the cursors it is assigning to see if it has already
named a cursor the same. Not only do you need to make sure that it isn't
issuing the same cursor name twice but also that you don't try and open up a
cursor for a statement handle that already has a cursor opened for it. This
is most likely the case you are dealing with here. See if statement handles
are reported in the IBX SQL trace output and look for a case where the same
statement handle is being used to open two cursors.
Since IBX is still in BETA development mode I think it is most likely that
the issue is in that base of code somewhere. You might try posting an
inquiry about this error to see if others have encountered it while using
IBX too. Hopefully this can get straightened out if it is an IBX bug because
the silent nature of cursor naming problems can be really horrific in a
system that is heavy multi-user oriented.
InterBase probably should do something about this in a future release. I
dealt with this so long ago with IBO that I had almost totally forgotten
about it. That was in 1996 and for all I know they already may have done
something too...
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
work with. The worst cases to deal with were the consequences that didn't
result in error messages but instead incorrect select statements. If two
users use the same cursor name they can get their results mixed up. No
kidding!
I ended up including cursor names in my SQL trace output just so that I
could keep tabs on them. InterBase will deal with cursors correctly if the
API is used correctly. I would suggest that you try and see if IBX will
output the names of the cursors it is assigning to see if it has already
named a cursor the same. Not only do you need to make sure that it isn't
issuing the same cursor name twice but also that you don't try and open up a
cursor for a statement handle that already has a cursor opened for it. This
is most likely the case you are dealing with here. See if statement handles
are reported in the IBX SQL trace output and look for a case where the same
statement handle is being used to open two cursors.
Since IBX is still in BETA development mode I think it is most likely that
the issue is in that base of code somewhere. You might try posting an
inquiry about this error to see if others have encountered it while using
IBX too. Hopefully this can get straightened out if it is an IBX bug because
the silent nature of cursor naming problems can be really horrific in a
system that is heavy multi-user oriented.
InterBase probably should do something about this in a future release. I
dealt with this so long ago with IBO that I had almost totally forgotten
about it. That was in 1996 and for all I know they already may have done
something too...
HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com
----- Original Message -----
From: "Kelly Salvage" <kelly@...>
To: <ib-support@egroups.com>
Sent: Wednesday, January 17, 2001 1:01 AM
Subject: [ib-support] Declare Cursor Already Exists??? HELP!!!
> Hi there
>
> I have been workin with interbase for a couple of years now, and have
> never had any problems that I could not solve, until now...
> I have an application that needs to dynamically load dlls, and pass a
> TIBdatabase component to a form created by the dll. So far, so good.
> I can open a query on the fomr returned by the dll, but this is not
> allways successfull. Sometimes I get the following error:
>
> "Dynamic SQL Error
> SQL error = -502
> Declared Cursor Allready Exists"
>
> If I move the Database fomonete from the data module to the main
> form, and pass it to the form created by the dll, it then works.
> However, if I add another table to the dlls form, I get this error
> again.
>
> I have lloked in the source code of interbase (dsql.c) where cursor
> names are declared and this error is raised if the cursor allready
> exists. Great: but I do not know how to explicitly name a cursor for
> a tIBtable or a TIBQuery, so this does not help.
>
> Is there something about dlls that I should know? Or does the problem
> lie in the way the IBX controls declare cursors, or (heaven forbid)
> does this problem lie in the gds32 dll?
>
> Is there a way I can declare a cursor name for a TIBTable or TDataset?
> Otherwise, is this a dll issue that can be resolved (I am a newbie
> when it comes to creating and using dlls).
>
> Thanks
> Kelly
>
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>