473,386 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

What is the stSCRFile code looking like

Dear Tom

With this code:

Public Function FTP(ascii As Boolean, send As Boolean, pathname As
String, FileName As String, server As String, serverpathname As String,
serverfilename As String, username As String, password As String,
Optional RstN As String, Optional RstFld As String)
Dim Fs As Object
Dim a As Variant
Dim RST As Recordset

Const script = "__temp_script.tmp"

'---
Dim asciiType As String
If ascii = True Then asciiType = "ascii" Else asciiType = "binary"
'---
Dim SendType As String
If send = True Then SendType = "Put " Else SendType = "Get "
'---create and open the file
Set Fs = CreateObject("Scripting.FileSy*stemObject")
Set a = Fs.CreateTextFile(pathname & "\" & script, True)
' write all the lines to the file
a.WriteLine "lcd " & Chr(34) & pathname & Chr(34)
a.WriteLine "open " & server
a.WriteLine username
a.WriteLine password
If (serverpathname <> "") Then a.WriteLine "cd " & serverpathname
If (ascii) Then
a.WriteLine asciiType
Else
a.WriteLine asciiType
End If
If RstN <> "" Then
Set RST = CurrentDb.OpenRecordset(RstN)
Do While Not RST.EOF
FileName = RST.Fields(RstFld) & ".html"
serverfilename = FileName
a.WriteLine SendType & FileName & " " & serverfilename
RST.MoveNext
Loop
Else
a.WriteLine SendType & FileName & " " & serverfilename
End If
a.WriteLine "bye"
'close file
a.Close
sFTP (pathname & "\" & script)
End Function

Private Sub sFTP(stSCRFile As String)
Dim stSysDir As String
'---
stSysDir = Environ$("COMSPEC")
stSysDir = Left$(stSysDir, Len(stSysDir) - Len(Dir(stSysDir)))
Call Shell(stSysDir & "ftp.exe -s:" & stSCRFile, vbNormalFocus)
End Sub
What does the stSCRFIle code look like? I mean what do you put inside
that file?

Thanks Marlene

Nov 13 '05 #1
1 1329
On 19 May 2005 04:51:44 -0700, "marlene" <ma******@comh.co.za> wrote:

Since you addressed this to me, I feel compelled to answer :-)

This code has two functions, a public one, and a private one. You're
only supposed to call the public one, named FTP.
The public function calls the private one, to do the work of FTP-ing a
file. That file has previously been created in the public function,
and it is located in <pathname>\__temp_script.tmp.
It contains instructions such as "lcd" and "open" that ftp.exe
understands. It also optionally sends a file to the other side.

There is a problem with this line:
Set Fs = CreateObject("Scripting.FileSy*stemObject")
Should be:
Set Fs = CreateObject("Scripting.FileSystemObject")

-Tom.
Dear Tom

With this code:

Public Function FTP(ascii As Boolean, send As Boolean, pathname As
String, FileName As String, server As String, serverpathname As String,
serverfilename As String, username As String, password As String,
Optional RstN As String, Optional RstFld As String)
Dim Fs As Object
Dim a As Variant
Dim RST As Recordset

Const script = "__temp_script.tmp"

'---
Dim asciiType As String
If ascii = True Then asciiType = "ascii" Else asciiType = "binary"
'---
Dim SendType As String
If send = True Then SendType = "Put " Else SendType = "Get "
'---create and open the file
Set Fs = CreateObject("Scripting.FileSy*stemObject")
Set a = Fs.CreateTextFile(pathname & "\" & script, True)
' write all the lines to the file
a.WriteLine "lcd " & Chr(34) & pathname & Chr(34)
a.WriteLine "open " & server
a.WriteLine username
a.WriteLine password
If (serverpathname <> "") Then a.WriteLine "cd " & serverpathname
If (ascii) Then
a.WriteLine asciiType
Else
a.WriteLine asciiType
End If
If RstN <> "" Then
Set RST = CurrentDb.OpenRecordset(RstN)
Do While Not RST.EOF
FileName = RST.Fields(RstFld) & ".html"
serverfilename = FileName
a.WriteLine SendType & FileName & " " & serverfilename
RST.MoveNext
Loop
Else
a.WriteLine SendType & FileName & " " & serverfilename
End If
a.WriteLine "bye"
'close file
a.Close
sFTP (pathname & "\" & script)
End Function

Private Sub sFTP(stSCRFile As String)
Dim stSysDir As String
'---
stSysDir = Environ$("COMSPEC")
stSysDir = Left$(stSysDir, Len(stSysDir) - Len(Dir(stSysDir)))
Call Shell(stSysDir & "ftp.exe -s:" & stSCRFile, vbNormalFocus)
End Sub
What does the stSCRFIle code look like? I mean what do you put inside
that file?

Thanks Marlene


Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Chris Cioffi | last post by:
I started writing this list because I wanted to have definite points to base a comparison on and as the starting point of writing something myself. After looking around, I think it would be a...
5
by: Almad | last post by:
Hello, I'm currently starting with Python as a language for writing websites. I must say that I'm overwhelmed by the number of choices I have (mod_python with publisher, Vampire, mps, Spyce),...
137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
14
by: Salad | last post by:
On the computer side of the businees there is me, the developer. Another person's role is that of the idea man...the person that knows the business and requirements and issues for the business. ...
13
by: William Ryan | last post by:
I just picked up a copy of John Robbins' debugging book and started to look at disassembled code. Anyway, I hate optional Parameters in VB, but I was checking them out to see what IL is created. ...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
11
by: plenty900 | last post by:
I was looking over someone's C++ code today and despite having written perfectly readable C++ code myself, the stuff I was looking at was worse than legalese. The people who are guiding the...
4
by: MikeB | last post by:
I'm looking at some code and found the -operator. In looking at the PHP manual at php.net, I can't find a description of what it does. I can find an example of where it is used, like on this page:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.