帮我看下这段代码,好像有问题
<% set conn=server.createobject("adodb.connection")
provider="provider=microsoft.jet.oledb.4.0;"
DBPath ="data source=" & Server.MapPath("db.xls")
conn.Open provider & DBPath
sql="select * from [test$]"
set rs=server.createobject("adodb.recordset")
Rs.open sql,conn,3,2
'打开文本文件
Dim LogFileName
LogFileName = "gz.txt"
set MyFileObject=server.CreateObject("Scripting.FileSystemObject")
set MyLogFile=MyFileObject.OpenTextFile(server.MapPath(LogFileName),2,true)
'逐行处理
do while not rs.eof
MyLogFile.Write(rs("t1"))
MyLogFile.Write "|"
MyLogFile.Write(rs("t2"))
MyLogFile.Write "|"
MyLogFile.Write(rs("t3"))
MyLogFile.Writeline
rs.movenext
loop
'关闭文件
MyLogFile.close
Rs.Close
Set Rs=nothing
conn.close
Set conn=nothing
'response.Redirect("gz.txt")
response.write "系统提示:"
%>
后面应该没问题,应该是连接数据库这儿有问题,没有使用过EXCEL数据库,高手帮我改一下,使用EXCEL数据库