请帮忙解释一下asp数据更新

来源:百度知道 编辑:UC知道 时间:2024/05/21 21:06:13
sub tvUpdate()
dim GetContent
dim fso,F1,F2,F3
dim Fpath
Const ForReading = 2
GetContent=getHTTPPage("http://www.tvmao.com/service/NetTV?u=ddd_noip_cn&p=ddd_noip_cn")
Fpath=server.mappath("tv.txt")
Set fso=server.createobject("Scripting.FileSystemObject")
''使用fso对象读取信息。
''打开要读取的文件
Set F1=fso.OpenTextFile(fpath, ForReading)
Set F2 = fso.GetFile(fpath)
'生成本地tv.txt
F1.write(getcontent)
F1.close
set F2=Nothing
';;;;;每次删除旧数据
conn.execute("delete from tv")
''直接读取本地的tv.txt文件,循环将数据入库
dim Fread,Line,Line3,sqlInsert,line4
set F1=fso.OpenTextFile(Fpath, 1)
on error resume next
do while not F1.atEndOfStream
''用do... loop循环体插入数据
Fread=F1.ReadLi

什么叫生成本地的tv.txt文件啊.
是不是在客户端生成文件啊
如果是这样,就应该用
Set fso=createobject("Scripting.FileSystemObject")
不要用server,因为它是在服务器上生成文件系统对象

希望能对你的问题有所帮助,若满意请采纳.谢谢