PowerBuild Application Execution Error R0006

zijiezhuang 2009-02-13 11:20:25
错误消息: Application terminated

Error:Invalid DataWindow row/column specified as line 32 in function of_update of object
w_update
函数
function of_update:

string ls_cph,ls_xmh,ls_gs
double je,je1,je2
integer li_count,li_col,i=1
string error_syntaxfromSQL, error_create
string new_sql, new_syntax
datastore dw_13
dw_13 = create datastore
new_sql = "select sjzd.xmh,sjzd.jsgs from cost,sjzd where dh = '"+ls_cph+"'"+" and sjzd.xmh = cost.xmh and sjzd.jsgs <> '' order by sjzd.xmh"
new_syntax = SQLCA.SyntaxFromSQL(new_sql, 'Style(Type= grid)', error_syntaxfromSQL)
IF Len(error_syntaxfromSQL) > 0 THEN
messagebox("错误", error_syntaxfromSQL)
ELSE
dw_13.Create(new_syntax, error_create)
IF Len(error_create) > 0 THEN
messagebox("错误", error_create)
END IF
END IF
dw_13.SetTransObject(SQLCA)
li_count = dw_13.Retrieve()
ls_cph = dh1
do while i<=li_count
ls_xmh = dw_13.getitemstring(i,'xmh') //在本地调试到这里就会弹出上班的错误
ls_gs = dw_13.getitemstring(i,'jsgs')
je = of_getgs(ls_gs,ls_cph)
update cost set je = :je where dh = :ls_cph and xmh = :ls_xmh using sqlca;
commit using sqlca;
i++
loop

我调试的时候连服务器上的数据调试就不会出现这个问题,但把数据库拷到本地上测试却有这个错误。大家帮帮忙。

of_update(ls_dh)传入一个单号

...全文
393 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
liubocy 2009-02-13
  • 打赏
  • 举报
回复
在sql字符串前面赋值,
zijiezhuang 2009-02-13
  • 打赏
  • 举报
回复
我的意思是说ls_cph 是在后面才赋值
zijiezhuang 2009-02-13
  • 打赏
  • 举报
回复
select sjzd.xmh,sjzd.jsgs from cost,sjzd where dh = '"+ls_cph+"'"+" and sjzd.xmh = cost.xmh and sjzd.jsgs

在后面赋值,等于dh=''这个有关系吗。
liubocy 2009-02-13
  • 打赏
  • 举报
回复
也可以用列号:ls_xmh = dw_13.object.#1[i]
liubocy 2009-02-13
  • 打赏
  • 举报
回复
要确定你动态创建的数据窗口的字段名是xmh还是sjzd_xmh。

或者加个as xmh试试
new_sql = "select sjzd.xmh as xmh,sjzd.jsgs from cost,sjzd where dh = '"+ls_cph+"'"+" and sjzd.xmh = cost.xmh and sjzd.jsgs <> '' order by sjzd.xmh"
AFIC 2009-02-13
  • 打赏
  • 举报
回复
ls_xmh = dw_13.getitemstring(i,'xmh') //在本地调试到这里就会弹出上班的错误
ls_gs = dw_13.getitemstring(i,'jsgs')
替换为
ls_xmh = dw_13.getitemstring(i,1)
ls_gs = dw_13.getitemstring(i,2)

609

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧