Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

select error: only cancel command is allowed when rows are pending

1,342 views
Skip to first unread message

shailen_patel

unread,
Feb 6, 2004, 9:24:05 AM2/6/04
to
I'm retrieving a large report into my window/DW . when user
closes the window befroe all the data is retrieved and opens
any other report immediatley then it gives a error message
"select error: only cancel command is allowed when rows are
pending"
in cosequery event of window i wrote a command
datawindowname.dbcancel() but it dosent work . so i need
help in how to cancel the retrieve and how to find out
retrieve is still pending or not . i didnt want to restrict
user that he can not close the window bfore retrieval .

Bruce Armstrong [TeamSybase]

unread,
Feb 6, 2004, 10:21:58 AM2/6/04
to
The connection has to be set to allow Asynch before a dbcancel will be
effective. You'll also need to put something (even a comment) in the
retrieverow event of the datawindow to force it to yield between row
retrievals.

Bruce Armstrong [TeamSybase]
http://www.teamsybase.com

Sixth Annual Sybase Tools Seminar - April 19 - Minneapolis, MN
http://www.powerobjects.com/seminar/?source=newsgroups

Two new books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups

Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com

ISUG Enhancement Requests
http://www.isug.com/cgi-bin/ISUG2/submit_enhancement

Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org

Bruce Armstrong [TeamSybase]

unread,
Feb 6, 2004, 1:37:57 PM2/6/04
to
The RetrieveRow probably isn't getting a chance to fire. Try this:

1. Create an instance variable that indicates that a retrieve is
occurring. Set it in the retrievestart event and clear it in the
retrieveend event.
2. Create a custom user event that sets the cancel_ret variable, issues
the DBCancel, and then does a close on the window.
3. In the closequery event, check the instance variable that indicates
a retrieve is occuring. If it is, cancel the close, and the call the
custom user event referenced above.

If a retrieve is occuring the close will be blocked long enough for the
window to get the retrieve cancelled, and then the close will be
automatically attempted again - working the second time.

shailen, patel wrote:
>
> Hello Bruce Armstrong
> thank you very much for your quick resply .
> I set up Async=1 but when i run dbcancel in closequeryevent
> of window it returns "-1" i got some commented code in
> retrieverow event also .i attache window also here .

> ------------------------------------------------------------------------
> Name: w_orbits.srw
> w_orbits.srw Type: Plain Text (text/plain)
> Encoding: base64

ma...@jeansbd.com

unread,
Aug 1, 2019, 4:39:56 AM8/1/19
to
0 new messages