ole 报错,急死个人,,帮帮忙啊。。
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