注册 登录
编程论坛 PowerBuilder

数据更新的问题?

jolly520 发布于 2006-07-22 13:42, 886 次点击

我在数据窗口中更改了一个数据,怎么样才能够把他更改到数据库中去呢?
代吗是:
long row_l , col_l
string str_rec
row_l=this.getclickedrow( )
col_l=this.getclickedcolumn( )
if row_l>0 and col_l>0 then
col_str=this.getitemstring( row_l, col_l) //获得点击的那一个数据

dw_1.accepttext()
dw_1.setitem( row_l , col_l , str_rec )  //str_rec为一个更新的数据
this.scrolltorow( row_l )

end if

谢谢啦.!

3 回复
#2
zhlqiao2006-07-22 15:47
   呵呵,怎么能先Accepttext()呢,还有别忘了Update()哟!还要看看数据窗口对象画板中是否设置了可以更新,默认是允许更新的。
#3
fgypblt2006-07-24 17:31
如2楼所述,或直接写入数据库,再刷新datawindow.
根据你的用途、实际情况,看哪种更适用,效率高,就用哪个方法
#4
daring2006-08-17 15:23
用update()不就行啦
1