using wodSFTP in access 97 - WeOnlyDo Discussion board

using wodSFTP in access 97 (General questions)

by Wee Ping, Thursday, January 19, 2006, 04:33 (6883 days ago)

Hi Support,
I am trying out your activeX(ocx) using access 97.
Here are the codes that I used to putfile.
[code]Private Sub Command3_Click()
ActiveXCtl0.login = user_id
ActiveXCtl0.hostname = abc.com
ActiveXCtl0.Password = xxxx
ActiveXCtl0.Connect
MsgBox State of Connection = & ActiveXCtl0.State
MsgBox Timer

'pause for 5 secs for the connnection to establish. Connection State:
Dim PauseTime, Start, Finish, TotalTime
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
'DoEvents ' Yield to other processes.
Loop

MsgBox State of Connection = & ActiveXCtl0.State
MsgBox Timer

ActiveXCtl0.putfile c: empsample.csv , /home
'object.Disconnect
ActiveXCtl0.disconnect
'Set ActiveXCtl0 = Nothing
End Sub[/code]

If you noticed, I am using the timer to delay processing so that I can move on to putfile only when connection is established(state = 3)
Unlike VB where this could be done in events, how can I achieve this in access 97?

How do I write codes to trap error if connection fails, or put file operation fails?

Thanks very much your time!

Re: using wodSFTP in access 97

by wodSupport, Thursday, January 19, 2006, 09:57 (6882 days ago) @ Wee Ping

Wee,

I think usage is pretty much the same as in VB. Just make sure you set Blocking property to true, due to way you're using the component.

If you still have problems, let me know.

Kreso