|
-
Aug 24th, 2000, 08:10 PM
#1
Thread Starter
Hyperactive Member
I have the following code that works:
Code:
Private Sub cmdSend_Click()
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT C:\Test.txt Test.txt"
End With
End Sub
However, I have a string problem because the following code will not work:
Code:
Private Sub cmdSend_Click()
Dim strFileHost As String, strFileRemote As String
strFileHost = "C:\Test.txt"
strFileRemote = "Test.txt"
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & strFileHost & " " & strFileRemote
End With
End Sub
I would appreciate any help. Thank you. 
[Edited by bedowin on 08-24-2000 at 09:31 PM]
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 08:27 PM
#2
Lively Member
strFileHost and strFileRemote have not been declared. Maybe switch them with strFileName and strFileTitle?
-
Aug 24th, 2000, 08:32 PM
#3
Thread Starter
Hyperactive Member
That was only a mistake in the post. I edited and corrected it.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 10:16 PM
#4
Fanatic Member
Maybe it's a pecularity of the .Execute method...
have you tried modifying it to:
Code:
Private Sub cmdSend_Click()
Dim strFileHost As String
Dim strFileRemote As String
Dim SendStr as String
strFileHost = "C:\Test.txt"
strFileRemote = "Test.txt"
SendStr = "PUT " & strFileHost & " " & strFileRemote
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , SendStr
End With
End Sub
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Aug 24th, 2000, 10:53 PM
#5
Thread Starter
Hyperactive Member
No luck.. it's very bizarre
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 11:07 PM
#6
Hyperactive Member
Bedowin,
If the code isn't working and you are getting an error it usually helps if you actually QUOTE the error that you are getting... including all numbers and descriptions.
Without this kind of information people don't know where to look.
-
Aug 25th, 2000, 12:34 AM
#7
Thread Starter
Hyperactive Member
No errors GenX, it just doesn't send the file period... that's the bizarre thing... however if I replace the string variables with the actual data it works just fine. I have also tested my string variables and they return the accurate values. I believe the problem lies in how the PUT statement is constructed with string variables in place of actual values. I am looking for someone who can represent this PUT clause with string variables in a simple working manner.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 25th, 2000, 03:08 AM
#8
Fanatic Member
Code:
Dim LocFile As String
Dim SerFile As String
LocFile = "C:\test.txt"
SerFile = "test.txt"
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & LocFile & " " & SerFile
End With
Give that a hoot...
Hope that helps,
D!m
PS. Just copy and paste this code onto a form with the inet control. It SHOULD work. If not then it could be because inet is a piece made by MS so i wouldn't rely on it much.
[Edited by Dim on 08-25-2000 at 04:11 AM]
-
Aug 25th, 2000, 07:04 AM
#9
Thread Starter
Hyperactive Member
And, how is that code any different from my initial post on the matter?
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|