当前位置: 代码迷 >> PB >> select error :only cancel command is allowed when the rows are异常
  详细解决方案

select error :only cancel command is allowed when the rows are异常

热度:297   发布时间:2016-04-29 09:12:08.0
select error :only cancel command is allowed when the rows are错误
在pb9.0中直接运行没有错误,编译后一执行就出select error :only cancel command is allowed when the rows are pending.错误,在数据创建检索中我也没做别的动作这是什么原因呀。 
 


------解决方案--------------------

1、在数据检索时执行了其它操作

2、retrieverow 这类事件中写了错误代码


问题可能出在代码上
------解决方案--------------------
问题应该出在数据窗口retrieverow事件

没有返回值,或者返回值非0和1,仔细检查一下代码

RetrieveRow event (DataWindows)


Description 

Occurs after a row has been retrieved.
PowerBuilder event information
Event ID: pbm_dwnretrieverow

Argument Description
row Long by value. The number of the row that was just retrieved
Web ActiveX event information
Event name: onRetrieveRow

Argument Description
Row Number. The number of the row that was just retrieved
Return value 

Set the return code to affect the outcome of the event:

0 Continue processing
1 Stop the retrieval

For information on setting the return code in a particular environment, see "About return values for DataWindow events".

Usage 

If you want to guard against potentially large queries, you can have code in the RetrieveRow event check the row argument and decide whether the user has reached a maximum limit. When row exceeds the limit, you can return 1 to abort the retrieval (in which case the retrieval cannot be resumed). 
A script in the RetrieveRow event (even a comment) can significantly increase the time it takes to complete a query.
Obsolete functions in PowerBuilder Instead of calling SetActionCode, use the RETURN statement with a return code instead.
  相关解决方案