using wodSFTP in access 97 (General questions)
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!