Click to See Complete Forum and Search --> : FTP: problem with the syntax


Federica Pavese
April 9th, 1999, 09:55 AM
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://uuuu:pppp@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!

Lothar Haensler
April 9th, 1999, 10:31 AM
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

Federica Pavese
April 12th, 1999, 06:59 AM
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

Lothar Haensler
April 12th, 1999, 07:03 AM
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?

Federica Pavese
April 12th, 1999, 08:41 AM
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 !

Lothar Haensler
April 12th, 1999, 08:51 AM
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?

Federica Pavese
April 12th, 1999, 09:58 AM
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.

Lothar Haensler
April 12th, 1999, 10:02 AM
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?

Federica Pavese
April 12th, 1999, 10:23 AM
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

Lothar Haensler
April 12th, 1999, 10:30 AM
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.

Federica Pavese
April 13th, 1999, 07:05 AM
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?

Lothar Haensler
April 13th, 1999, 08:01 AM
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)

Federica Pavese
April 13th, 1999, 08:44 AM
These are the Inet1 properties:
Inet1.Protocol = "icFTP"
Inet1.RemoteHost = "hhhh"
Inet1.UserName = "uuuu"
Inet1.Password = "pppp"
So, the Inet1.URL is "ftp://uuuu:pppp@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.

Lothar Haensler
April 13th, 1999, 08:49 AM
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.

Federica Pavese
April 13th, 1999, 09:01 AM
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.

Lothar Haensler
April 13th, 1999, 09:09 AM
Ok, now we're getting closer:
after the Inet1.Execute , "CLOSE" there is an EXIT SUB

missing.
That's why your code runs into the errorhandler, although there is no error. Thus you get the "Resume without error" message.

Now, "somewhere" there is "some code", that does something that fills the rdoError collection.
That's the place to look for...
But, that has never been posted, has it?

Federica Pavese
April 13th, 1999, 10:01 AM
OK, I'm a stupid.
Now, I have the EXIT SUB writed. And the error message is this:

35764 Still executing last request
IM006: [INTERSOLV][ODBC Informix driver]Driver's SQLSetConnectAttr failed. 0
S1C00: [INTERSOLV][ODBC Informix driver]Optional feature not implemented. 0

I don't understand what means "Still executing last request". (I don't speak English)
You say : "somewhere" there is "some code", that does something that fills the rdoError collection.
Yes ! But which code? I have posted the code with the connection string and the code to the Inet control. The others codes aren't connection's codes. For example:

Function LlenarGrilla()
consulta = "SELECT * FROM contratos order by ejercicio"
Set rstTemp = conNumeros.OpenRecordset(consulta, dbOpenDynaset)
While Not rstTemp.EOF
grilla.AddItem rstTemp!ejercicio & Chr(9) & rstTemp!delegacion
rstTemp.MoveNext
Wend
rstTemp.Close
End Function

...where rstTemp is a Recordset and grilla is a Grid control

Lothar Haensler
April 13th, 1999, 10:06 AM
"Still executing last request" means that ADO (or whatever your database interface is) is still busy executing an SQL request that you issued and is not yet done with it, while you are already trying to do "something" else on the same connection.

The "SQLSetConnectAttr failed" error means that you are trying to set a connect attribute that your driver does not understand.
You might wanna use ODBC tracing mechanisms to figure out what really happens. Depending on your ODBC versíon and operating system OdBCtracing can be enabled via control panel/odbc.

Something you might wanna try:
replace dbOpenDynaset with dbOpenSnapshot

Federica Pavese
April 13th, 1999, 11:39 AM
I'm using the Intersolv 3.11 32-bit Informix9 ODBC driver.
So, I have called Informix technical support and they have said me that this driver can't to transfer files between Unix and W95. It can to connect only with the Informix database. I need other driver.
Lothar, thanks for your patience, and thanks for all.

Federica, Argentina