ole 报错,急死个人,,帮帮忙啊。。

vs_net 2008-05-16 04:33:44
R0039错误
APPlication terminated

Error:Error accessing external object property remoteaddress at line 1 in function uf_connrct of object w_sa_spassure.

这个错误是怎么回事,怎么解决啊??

代码如下:其中*是被替换的部分

forward
global type w_sa_spassure from w_report_base
end type
type cb_1 from commandbutton within w_sa_spassure
end type
type cb_2 from commandbutton within w_sa_spassure
end type
type cb_4 from commandbutton within w_sa_spassure
end type
type st_1 from statictext within w_sa_spassure
end type
type ole_1 from olecustomcontrol within w_sa_spassure
end type
end forward

global type w_sa_spassure from w_report_base
cb_1 cb_1
cb_2 cb_2
cb_4 cb_4
st_1 st_1
ole_1 ole_1
end type
global w_sa_spassure w_sa_spassure

type variables
int ftp_handel=0
end variables

forward prototypes
public function integer uf_connect ()
public function integer uf_getfile (string source_name, string dest_name)
public function integer uf_putfile (string source_name, string dest_name)
public function integer uf_disconnect ()
end prototypes

public function integer uf_connect ();ole_1.object.RemoteAddress="*.*.*.*"
ole_1.object.UserName="****"
ole_1.object.Password="****"
int i
ftp_handel=0
ole_1.object.connect()
return ftp_handel
end function

public function integer uf_getfile (string source_name, string dest_name);ole_1.object.RemoteFile = source_name
ole_1.object.LocalFile = dest_name
ftp_handel=0
ole_1.object.getFile()
return ftp_handel
end function

public function integer uf_putfile (string source_name, string dest_name);ole_1.object.RemoteFile = dest_name
ole_1.object.LocalFile =source_name
ftp_handel=0
ole_1.object.PutFile()
return ftp_handel
end function

public function integer uf_disconnect ();ole_1.object.Disconnect()
return ftp_handel
end function

on w_sa_spassure.create
int iCurrent
call super::create
this.cb_1=create cb_1
this.cb_2=create cb_2
this.cb_4=create cb_4
this.st_1=create st_1
this.ole_1=create ole_1
iCurrent=UpperBound(this.Control)
this.Control[iCurrent+1]=this.cb_1
this.Control[iCurrent+2]=this.cb_2
this.Control[iCurrent+3]=this.cb_4
this.Control[iCurrent+4]=this.st_1
this.Control[iCurrent+5]=this.ole_1
end on

on w_sa_spassure.destroy
call super::destroy
destroy(this.cb_1)
destroy(this.cb_2)
destroy(this.cb_4)
destroy(this.st_1)
destroy(this.ole_1)
end on

event open;call super::open;dw_cond.getchild('citycode',idwc_areaid)
idwc_areaid.settransobject(SQLCA)
idwc_areaid.retrieve()


dw_cond.object.date_s[1]=date(mid(is_billingcyclid,1,4)+"."+mid(is_billingcyclid,5,2)+".01")
if not DirectoryExists ("./upfilebz") then
CreateDirectory ( "./upfilebz" )
end if

if not DirectoryExists ("./upfilesj") then
CreateDirectory ( "./upfilesj" )
end if

end event

type cb_exit from w_report_base`cb_exit within w_sa_spassure
end type

type cb_view from w_report_base`cb_view within w_sa_spassure
integer x = 1687
integer y = 1800
end type

type cb_ok from w_report_base`cb_ok within w_sa_spassure
boolean visible = false
integer x = 2240
integer y = 1796
end type

type cb_print from w_report_base`cb_print within w_sa_spassure
integer x = 782
integer y = 1800
end type

type cb_save from w_report_base`cb_save within w_sa_spassure
integer x = 1234
integer y = 1800
end type

type dw_display from w_report_base`dw_display within w_sa_spassure
integer height = 1428
string dataobject = "dw_sa_sp_downloadmoney"
end type

type gb_1 from w_report_base`gb_1 within w_sa_spassure
integer height = 1524
end type

type dw_cond from w_report_base`dw_cond within w_sa_spassure
integer y = 1652
integer height = 132
string dataobject = "dw_cond_sp_shijie"
end type

event dw_cond::itemchanged;call super::itemchanged;
if dwo.name='date_type_1' then

dw_display.reset()
end if
end event

type dw_cond_iii from w_report_base`dw_cond_iii within w_sa_spassure
boolean visible = false
end type

type gb_2 from w_report_base`gb_2 within w_sa_spassure
integer y = 1556
integer height = 240
end type

type cb_1 from commandbutton within w_sa_spassure
boolean visible = false
integer x = 2606
integer y = 1792
integer width = 283
integer height = 84
integer taborder = 90
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "下载[&D]"
end type

event clicked;date ld_date_s
string ls_date_s
long ls_row


ld_date_s = dw_cond.getitemdate(1,'date_s')
ls_date_s = string(ld_date_s,'yyyymm')
dw_display.dataobject="dw_sa_sp_uploadmoney"
dw_display.settransobject(sqlca)
ls_row=dw_display.retrieve(ls_date_s)
if ls_row>0 then
if MessageBox("提示", "['"+ls_date_s+"']数据已经下载是否重新下载?",Question!, YesNo!, 2)=2 then
return
else
delete tm_sa_sp_uploadmoney where billingcycleid=:ls_date_s;
if sqlca.sqlcode=0 then
commit;
ls_row=dw_display.retrieve(ls_date_s)
else
rollback;
Messagebox("提示","数据清理失败")
end if
end if
end if
string ls_filename
ls_filename = ls_date_s + ".txt"
int li_FileNum
li_FileNum = FileOpen("translist.txt",LineMode!, Write!, LockWrite!, Replace!)
if li_FileNum=-1 then
Messagebox("提示","下载:打开缓冲文件失败,请检查文件是否被占用")
return
else
FileWrite(li_FileNum, "D:"+ls_filename)
FileClose(li_FileNum)
end if
parent.enabled=false

...全文
281 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
vs_net 2008-05-20
  • 打赏
  • 举报
回复
在插入ole控件时pb就自动退出。

我用的是pb8.0

郁闷。

源代码都在帖子里面。

我是中途接手的,崩溃。
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
该控件不是你自己放的吗?它大概是个什么控件,你总知道吧,在源里找下!
vs_net 2008-05-16
  • 打赏
  • 举报
回复
ole control name
这里是:unkonwn

应该就是这里的原因了

我怎么能知道原来的是什么名字呢。。


在source里有没有啊。

我哭。。。
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
OCX
jlwei888 2008-05-16
  • 打赏
  • 举报
回复
我说的ocx控件
vs_net 2008-05-16
  • 打赏
  • 举报
回复
我也是这样认为的,
而且我又把他改回去了
还是不行,
应该是其他地方的问题。


现在真的是没办法拉
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
browser 察看 该控件的属性
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
请检查ole 关联控件是否 变化?
个人觉得你上面俩个改动和ole 所报的错,没什么关系!
vs_net 2008-05-16
  • 打赏
  • 举报
回复
ole和一个cb关联。

ip,用户名,密码
都是写死的。没有改动过。

现在就郁闷


都不知道从那里找起。
vs_net 2008-05-16
  • 打赏
  • 举报
回复
ole_1.object.RemoteAddress="*.*.*.*"


*.*.*.*

这是一个ip地址。
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
ole_1.object.RemoteAddress="*.*.*.*"
=======================================
ole 对象没有这项属性!
jlwei888 2008-05-16
  • 打赏
  • 举报
回复
你看那个OLE是和什么控件关联的!
vs_net 2008-05-16
  • 打赏
  • 举报
回复
我qq:894201537

方便的话加我。
分可定不会少的啊

呵呵
vs_net 2008-05-16
  • 打赏
  • 举报
回复
我改回去试过了
,还是不好使。

可能我无意间把ole改了啊

ole应该怎么编辑啊。
jlwei888 2008-05-16
  • 打赏
  • 举报
回复
你再改回去试试,
现在报的错是OLE属性问题,很有可能是OLE对象的问题!那个软件也动了吗?
vs_net 2008-05-16
  • 打赏
  • 举报
回复
还有就是

//---
ls_temp=string(dw_display.object.computer_1[ls_row0],"###0.00")
if isnull(ls_temp) then ls_temp=""
ls_line=ls_line+" ¦ ¦"+ls_temp
//---
改成
//---
ls_temp=string(dw_display.object.feesum1[ls_row0],"###0.00")
if isnull(ls_temp) then ls_temp=""
ls_line=ls_line+" ¦ ¦"+ls_temp
//---

只改了这两个地方。
vs_net 2008-05-16
  • 打赏
  • 举报
回复
开始是好使的
我的改动是


st_1.text="FTP:连接成功"
if parent.uf_putfile(ls_filename,"/uploadmoney/"+ls_filename)=0 then
改成:
st_1.text="FTP:连接成功"
if parent.uf_putfile(ls_filename,"/downloadmoney/"+ls_filename)=0 then

只是把路径改了。


我想问一下,会不会是我的机器丢失了一些dll文件造成的。
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
不好意思,没看到你下面还贴了这么多,抱歉,继续看.......
SKY_4K_PPM 2008-05-16
  • 打赏
  • 举报
回复
Error accessing external object property remoteaddress at line 1 in function uf_connrct of object w_sa_spassure.
========================================================================================
uf_connect 第一行 ole 有remoteaddress的属性没有? 还有没见你 声明ole,也没见你创建ole
怎么直接就出现了ole_1? 也没有连接具体的 application ,要做什么别人怎么猜得到?
jlwei888 2008-05-16
  • 打赏
  • 举报
回复
原来正常吗?你改了什么地方!ole软件是否正常?
加载更多回复(3)

604

社区成员

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

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