CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Join Date
    Apr 1999
    Posts
    29

    FTP: problem with the syntax

    Hi !
    I want to retrieve a file from a VB application. This file is in a UNIX server. My application is in a win95 client machine. I use the Internet Transfer Control and the Execute method. I have these properties:

    Inet1.Protocol = "icFTP"
    Inet1.RemoteHost = "hhhh"
    Inet1.UserName = "uuuu"
    Inet1.Password = "pppp"
    So, the Inet1.URL is "ftp://uuuuppp@hhhh"

    The file (named "file1.jpg") is in this directory: "usr/systems/digital/disk1"

    I have writed this:
    Inet1.Execute Inet1.URL, "GET usr/systems/digital/disk1/file1.jpg C:\my documents\file2.jpg"

    But, something fails.
    How may I the Execute sentence to write?

    Thanks in advance!




  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    excerpt from MSDevnet:
    "Then you can the Execute method to execute FTP commands such as GET; in this case, we'll download a file named source.txt from the FTP server and save it as c:\target.txt:

    Inet1.URL = "ftp://ftp.private.com"
    Inet1.UserName = "George Washington"
    Inet1.Password = "no_lies"
    Inet1.Execute , "GET source.txt C:\target.txt"
    .
    .
    .
    In this way, you use the Execute method to execute FTP commands (just as you might in a command-line FTP program). Finally, we execute a CLOSE command to close the connection:

    Inet1.URL = "ftp://ftp.private.com"
    Inet1.UserName = "George Washington"
    Inet1.Password = "no_lies"
    Inet1.Execute , "GET source.txt C:\target.txt"
    —> Inet.Execute ,"CLOSE"
    "
    HTH


  3. #3
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    Thanks Lothar, but that is that I have made.
    I have used the GET command, but I have this error:
    0
    01S00: [INTERSOLV][ODBC Informix driver]Invalid attribute in connection string: server. 0
    IM006: [INTERSOLV][ODBC Informix driver]Driver's SQLSetConnectAttr failed. 0
    S1C00: [INTERSOLV][ODBC Informix driver]Optional feature not implemented. 0
    20 Resume without error


    Federica


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    I don't see how your problem relates to FTP syntax.
    Obviously it's an error message from the Informix ODBC driver. Is this a message from your UNIX program? Does the program work when you execute it in your UNIX environment?


  5. #5
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    Lothar,
    you're reason. This is an error message from the Informix ODBC driver. But I don't know why. When I write:
    a=Inet1.StillExecute, then a=False.
    Obviously, the Internet Transfer control isn't busy.
    Have you any suggestion ?

    Thanks !


  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    the message says that one of your Connect Attributes is wrong.
    Does your UNIX program run without problems if you run it stand-alone, i.e. without executing it via FTP?


  7. #7
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    Which UNIX program? I have the VB program in my computer (a WIN95 client machine).
    Sorry but I'm beginning with VB. Maybe I don't understand your question.


  8. #8
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    OK, I thought you were trying to communicate to a UNIX program via FTP that does a database access to an informix database.
    If I understand you correctly you are trying to access an Informix database via a VB program and get the error message you mentioned earlier when you try to log on to that database.

    Could you specify the connect string you use for loggin on to the database?
    What interface do you use (ADO? DAO? RDO?)?
    and what VB version?


  9. #9
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    Yes, I am trying to access an Informix 7 database via a VB program.

    Connect string:
    Set wrkODBC = CreateWorkspace("", "Contratos", "", dbUseODBC)
    Set conNumeros = wrkODBC.OpenConnection("conexion1", dbDriverNoPrompt, , "ODBC;DATABASE=dbdb;UID=uuuu;PWD=pppp;server=ssss;driver=INTERSOLV 3.11 32-BIT INFORMIX 9;DSN='scanner9'")
    Interface: DAO
    VB version: 5.0




  10. #10
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    I'm not an Informix expert, but a few things confuse me here:
    I wouldn't set the "scanner9" DSName in single or double qoutes.
    I would not specify driver, server and DSN in the same connectstring.
    I'd try specifying dbDriverComplete (interactive login), set a breakpoint after the set ... OpenConnection

    statement, complete the ODBC login dialog and print out the ConNumeros.Connect property in VB's immediate window to see what ODBC has filled in.
    If your connection works, use that new information as a connection string.



  11. #11
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    Hi Lothar,
    my connection string was good. The connection works. Likewise, I have changed it. Now the connection strign is like the ConNumeros.Connect property. And it works too.
    The problem ocurrs later, when I write this:
    Inet.OpenURL (Inet.URL)
    a = Inet.StillExecuting (a is False)

    I think that the problem is with the URL, but I don't know.
    Can you help me?








  12. #12
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    OK, what exactly is the error number and message you get and in which source line?
    (The previous error message was obviously related to ODBC)


  13. #13
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    These are the Inet1 properties:
    Inet1.Protocol = "icFTP"
    Inet1.RemoteHost = "hhhh"
    Inet1.UserName = "uuuu"
    Inet1.Password = "pppp"
    So, the Inet1.URL is "ftp://uuuuppp@hhhh"

    The file (named "file1.jpg") is in this directory: "usr/systems/digital/disk1"

    I have writed this:
    Sub Command_Click()
    Inet1.OpenURL (Inet1.URL)
    a = Inet1.StillExecuting 'here a is False
    Inet1.Execute Inet1.URL, "GET usr/systems/digital/disk1/file1.jpg C:\file2.jpg"
    Inet1.Execute , "CLOSE"
    End Sub()

    Later the last sentence I have these error messages:
    0
    IM006: [INTERSOLV][ODBC Informix driver]Driver's SQLSetConnectAttr failed. 0
    S1C00: [INTERSOLV][ODBC Informix driver]Optional feature not implemented. 0
    20 Resume without error
    IM006: [INTERSOLV][ODBC Informix driver]Driver's SQLSetConnectAttr failed. 0
    S1C00: [INTERSOLV][ODBC Informix driver]Optional feature not implemented. 0

    Yes, I know, is an ODBC driver error. But I can to write and to retrieve data. Only when I use the Internet Transfer control, I have problems.
    Thanks for your patience.


  14. #14
    Join Date
    May 1999
    Posts
    3,332

    Re: FTP: problem with the syntax

    looks like we are going to start all over again? :-)
    Something is fishy here.
    I don't see any database calls in your code and still, you get database errors?
    "resume without error" means somethins is wrong with your error handling code, but I don't see any error handling code in the code you posted.

    Honestly, I don't see how the code you posted relates to the error messages you get.
    Sorry, but there's not much I can do.

    Good luck.


  15. #15
    Join Date
    Apr 1999
    Posts
    29

    Re: FTP: problem with the syntax

    OK.
    I have writed only the problematic code. But all the code is:

    Sub Command_Click
    Dim er As rdoError
    On Error GoTo CnEh

    Inet1.OpenURL (Inet1.URL)
    a = Inet1.StillExecuting
    Inet1.Execute Inet1.URL, "GET usr/systems/digital/disk_01/file1.jpg c:/file2.jpg"
    Inet1.Execute , "CLOSE"

    CnEh:
    Debug.Print Err, Error
    For Each er In rdoErrors
    Debug.Print er.Description, er.Number
    Next er
    Resume Next
    End Sub

    And I have other code to retrieving data with a Grid control, Textbox controls, etc. All makes good. If you want, I can send it to you.
    Please, don't let me alone.


Page 1 of 2 12 LastLast

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

Featured