Results 1 to 11 of 11

Thread: ftp problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    ftp problem

    VB Code:
    1. Option Explicit
    2. Dim Inet1
    3.  
    4.  
    5.  
    6. Private Sub Timer1_Timer()
    7.  
    8. 'Upload or download files to FTP sites u
    9. 'sing only 5 lines of code!'Thanks for the example Venari, it's great to get 'shown up' sometimes! >:-D
    10. With Inet1
    11. .Protocol = icFTP
    12. .UserName = "user" 'FTP servers require a valid logonid and password
    13. .Password = "pass" 'before they Let you upload.
    14. .RemoteHost = "mysite"
    15. .Execute , "SEND C:\demo"
    16. End With
    17. End Sub

    I get Variable not defined error. Something with icFTP I think.

  2. #2
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: ftp problem

    try this
    VB Code:
    1. Option Explicit
    2. Dim Inet1
    3.  
    4.  
    5.  
    6. Private Sub Timer1_Timer()
    7.  
    8. 'Upload or download files to FTP sites u
    9. 'sing only 5 lines of code!'Thanks for the example Venari, it's great to get 'shown up' sometimes! >:-D
    10. With Inet1
    11. [B].Protocol = 2[/B]
    12. .UserName = "user" 'FTP servers require a valid logonid and password
    13. .Password = "pass" 'before they Let you upload.
    14. .RemoteHost = "mysite"
    15. .Execute , "SEND C:\demo"
    16. End With
    17. End Sub

    why are you using 'Dim Inet1' ? ? you should remove that and just drag the Inet onto your form, I think thats causing the error
    Chris

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: ftp problem

    Quote Originally Posted by the182guy
    try this
    why are you using 'Dim Inet1' ? ? you should remove that and just drag the Inet onto your form, I think thats causing the error
    Someone told me

    How would I drag Inet onto my form, sorry I am new.

  4. #4
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: ftp problem

    okay go to the menubar at the top click on project>components>microsoft Internet Transfer Control

    then you will notice the little Inet icon appear in the toolbox on the left handside, just click on it and drag it onto the form, just like you would drag a command button or textbox etc
    Chris

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: ftp problem


    I get this error.

    msinet.ocx is in my system32 folder.

  6. #6
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: ftp problem

    which version of VB do you have? is it VB6 Enterprise, or Standard, etc? I thnk thats the problem
    Chris

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: ftp problem

    No, its enterprise, sorry...
    I just tried this:
    1. Locate Regsvr32.exe on your machine. Note its path.
    2. Locate the offending OCX file(s), usually found in the Windows\System folder for Windows 95, Windows 98, and Windows Me, or the Windows\System32 folder for Windows NT and Windows 2000.
    3. On the Start menu, click Run.
    4. In the Run dialog box, type the following:

    <Path to RegSvr32>\REGSVR32.EXE /u <Path to OCX>\OCXFILE.OCX

    For example:

    C:\Devstudio\VB\REGSVR32.EXE /u C:\Winnt\System32\COMCTL32.OCX

    NOTE: If Regsvr32.exe is in the System or System32 folder, the path is optional.
    5. If you are reinstalling an older version of the control, you should delete/remove the .OCX, .OCA and .DEP files so they will be replaced.
    6. Repeat the previous 3 steps for each offending OCX.
    7. On Control Panel, click Add\Remove Programs.
    8. Select Visual Basic, and click Add\Remove.
    9. Click Reinstall when the options (Add\Remove, Remove All, Reinstall) dialog box appears.
    http://support.microsoft.com/default...b;en-us;177799

    and I recieved an error and now the inet is completly gone from the components menu.

    The above did not work, still getting same error.
    Last edited by uainfantry; Apr 13th, 2006 at 08:39 PM.

  8. #8
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: ftp problem

    Did you buy VB6, or did you get it from someone?

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: ftp problem

    My friend has it, I need a file from the cd?

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    18

    Re: ftp problem

    Well, I can't get it to work.

    Is there another way for me to add a script to a timer which would upload a file at a set time interval. I need something simple.

    I found a complete project for an ftp program but I can't figure out how to extract the code I need from it.

    Something wininet.dll?
    Last edited by uainfantry; Apr 15th, 2006 at 02:58 AM.

  11. #11
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: ftp problem

    Quote Originally Posted by uainfantry
    My friend has it
    Does your code work on your friend's computer?

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