Results 1 to 9 of 9

Thread: String Difficulty

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316
    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

  2. #2
    Lively Member
    Join Date
    Jun 2000
    Posts
    122
    strFileHost and strFileRemote have not been declared. Maybe switch them with strFileName and strFileTitle?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316
    That was only a mistake in the post. I edited and corrected it.
    Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional

  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    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!)

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316

    Unhappy

    No luck.. it's very bizarre
    Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional

  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    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.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316

    Exclamation

    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

  8. #8
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    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]
    Dim

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    316

    Question

    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
  •  



Click Here to Expand Forum to Full Width