T
Tim
Getting an odd result.
Shelling FTP and, when it completes, sending an e-mail message (using
SendObject) that includes the results of a query.
If I do the Shell first and the SendObject second, the FTP works but I get
the SendObject failes with the message:
'Outputto' isn't available now.
If I swap the order - do the SendObject first, and the Shell() second, the
e-mail message is created okay, but the Shell appears to fail because the
FTP 'put' never happens.
'here's the FTP
strCommand = "FTP.exe -s:" & strFTPScriptFile & " >" &
strFTPLogFileName
lngPid = Shell(strCommand)
which equates to:
FTP.exe -s:tmpFTP.txt
There's some other code to build the components of the e-mail and then:
' here's the e-mail
DoCmd.SendObject acSendQuery, strQueryName, acFormatXLS,
strMailRecipients, , , _
"Daily Manager New Cash Summary", strMessage, False
Is there something fishy about the "shell" function? Does it set / verify a
a setting somehwere that would cause problems? I've also had problems with
doing multiple shell commands. It's like... if the first one works, the
second one doesn't. I can swap them.. and the one that originally failed
all of a sudden works.
So... which ever command is executed first will work. That appaers to be
the same thing that is happening here. It's kinda like an internal error
code or ??? is being set - enven if if the "shell" is successful - that
needs to be reset before doing the next activity.
Very odd.
Shelling FTP and, when it completes, sending an e-mail message (using
SendObject) that includes the results of a query.
If I do the Shell first and the SendObject second, the FTP works but I get
the SendObject failes with the message:
'Outputto' isn't available now.
If I swap the order - do the SendObject first, and the Shell() second, the
e-mail message is created okay, but the Shell appears to fail because the
FTP 'put' never happens.
'here's the FTP
strCommand = "FTP.exe -s:" & strFTPScriptFile & " >" &
strFTPLogFileName
lngPid = Shell(strCommand)
which equates to:
FTP.exe -s:tmpFTP.txt
There's some other code to build the components of the e-mail and then:
' here's the e-mail
DoCmd.SendObject acSendQuery, strQueryName, acFormatXLS,
strMailRecipients, , , _
"Daily Manager New Cash Summary", strMessage, False
Is there something fishy about the "shell" function? Does it set / verify a
a setting somehwere that would cause problems? I've also had problems with
doing multiple shell commands. It's like... if the first one works, the
second one doesn't. I can swap them.. and the one that originally failed
all of a sudden works.
So... which ever command is executed first will work. That appaers to be
the same thing that is happening here. It's kinda like an internal error
code or ??? is being set - enven if if the "shell" is successful - that
needs to be reset before doing the next activity.
Very odd.