'送你一个过程吧,应该相比之下会容易看懂些,有错的话请指出来哦
DBname="数据库名"
path="../new"
filepath="../new/" &Rs("ID") &DBname &".Html"
call SaveToFile(path,filepath,FileContent) '文件夹路径,文件路径,文件内容
Rs.MoveNext
Loop
End If
'**************在数据库记录集循环体中
Sub SaveToFile(path,Filepath,FileContent)
Dim Fso ,File
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
if fso.FolderExists(Server.Mappath(path))=false then fso.CreateFolder(Server.Mappath(path))
if fso.fileExists(Server.Mappath(filepath))=true then fso.deletefile(Server.Mappath(filepath))
Set File = Fso.createTextFile(Server.Mappath(FilePath))
File.Write (FileContent)
File.Close
Set File=Nothing
Set Fso=Nothing
End Sub
%>
可以,用fso
<script language="javascript" runat="server">
var conn=new ActiveXObject("ADODB.Connection")
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0Data Source=myTest.mdb"
conn.Open()
var rs = new ActiveXObject("ADODB.Recordset")
rs.LockType=rs.CursorType=1
var sql="SELECT * FROM 用户信息表"
rs.Open(sql,conn)
</script>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)