When you get an error on connect - WeOnlyDo Discussion board

When you get an error on connect (General questions)

by Scots, Thursday, November 17, 2011, 17:51 (4753 days ago)

I am using powerbuilder with wodftpdlx
I use a clicked event on a button to connect and send a file
the putfile is on the connected event
but... if I get an errorcode, I do a return.. before
I try to do the put file
I'm getting an error when it returns back
which doesn't make a lot of sense
below is the code from the clicked event... and after
that on the connected event
shouldn't it just return to the connect call

clicked
ole_cer = CREATE oleobject
ole_cer.ConnectToNewObject( WeOnlyDo.Certificate.1 )

if override = 0 then
ole_cer.generatekey(0)
ole_cer.savekey(f_path)
end if

//ole_ftp.LicenseKey = XXXX-XXXX-XXXX-XXXX
ole_ftp.object.hostname = ftp_site
ole_ftp.object.login = ftp_acc
ole_ftp.object.password = ftp_pass
ole_ftp.object.authentication = 1
ole_ftp.object.transfermode = 0
ole_ftp.object.blocking = 1
ole_ftp.object.protocol = 1
ole_ftp.object.compression = 6
ole_ftp.object.passive = 1
ole_ftp.object.port = 22

p_state = 1
f_list = cuser_directory+'JS11_SEND*.*'
counter = 0
counter_tot = 0
destroy ole_cer

ole_ftp.object.connect()

if c_value = 0 then
messagebox('Complete','Stats Setup File Sent Sucessfully')
end if


connected
string local_send, remote_send, remote_file

If ErrorCode <> 0 Then
messagebox('ERROR','UNABLE TO CONNECT TO FTP SITE, CONTACT SUPPORT')
return
end if

//remote_file = ole_ftp.object.remotepath + filename
//ole_ftp.object.remotepath='/sstyer/'

ole_ftp.object.putfile(f_path)


Complete thread: