To yeskert1:
以下代码是我一位同事写的,是ASP的。他的系统可以正常运行。
非常感谢您的帮忙!
dim rs,sql,filename,fs,myfile,x,link,f_time,f_date,f_file
Set fs = server.CreateObject("scripting.filesystemobject")
f_file='temp'
session("job_file")="files/"&f_file&".xls"
filename = "D:/files/"&f_file&".xls"
if fs.FileExists(filename) then
fs.DeleteFile(filename)
end if
set myfile = fs.CreateTextFile(filename,true)
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open session("job_sql"),session("objdbconnection"),1,1
if not rs.EOF then
dim strLine,responsestr
strLine=""
For each x in rs.fields
strLine= strLine & x.name & chr(9)
Next
myfile.writeline strLine
Do while Not rs.EOF
strLine=""
for each x in rs.Fields
strLine= strLine & x.value & chr(9)
next
myfile.writeline strLine
rs.MoveNext
loop
end if
rs.Close
set rs = nothing
set myfile = nothing
Set fs=Nothing