基于B/S结构的MIS课程网上考试系统的设计与实现 第11页
附 录
ASP无组件上传(EXCEL into SQL2000)
CODEPAGE="936"%>
<!--#include file="conn.inc"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="
<head>
<meta http-equiv="Refresh" content="0.1;url=Students.asp" >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Upload</title>
</head>
<body>
<%
Dim PatnNow
PatnNow="uploadfile/ultrawebgrid1.xls"
Dim ConnXls,Driver,DBPath,Rs
Set ConnXls = Server.CreateObject("ADODB.Connection")
Driver = "Driver={Microsoft Excel Driver (*.xls)};"
DBPath = "DBQ=" & Server.MapPath(PatnNow)
ConnXls.Open Driver & DBPath
Sql="Select * From [Sheet1$] "
Set Rs=ConnXls.Execute(Sql)
IF Rs.Eof And Rs.Bof Then
Response.write "<br><br>没有找到您需要的数据!!"
Else
Do While Not Rs.EOF
conn.execute"insert into yonghu (UserID,Username,pwd,Campus,Grade,Classno,Duties,Ifadmin) values ('"&Rs("UserID")&"','"&Rs("Username")&"','"&Rs("pwd")&"','"&Rs("Campus")&"','"&Rs("Grade")&"','"&Rs("Classno")&"','"&Rs("Duties")&"','"&Rs("Ifadmin")&"')"
'Response.write Rs("接入号")&"<br>"
Rs.MoveNext
Loop
End IF
Rs.Close
Set Rs=nothing
ConnXls.Close
Set ConnXls=Nothing
conn.close
set conn=nothing
Response.Write "<script>alert('生成EXCEL文件成功')</script>"
%>
</script>
</body>
</html>
ASP无组件SQL导出EXCEL
CODEPAGE="936"%>
<!--#include file="conn.inc"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.751com.cn
<head>
<META http-equiv="Refresh" content="0.1;url=admindatabase.asp" >
<body>
<%
Response.Charset = "UTF-8"
dim s,sql,filename,fs,myfile,x
Set fs = server.CreateObject("scripting.filesystemobject")
filename=Server.MapPath("Exambase\"&year(now)&"-"&month(now)&"-"&day(now)&"_"&hour(now)&"-"&minute(now)&"_Exambase.xls")
if fs.FileExists(filename) then
fs.DeleteFile(filename)
end if
set myfile = fs.CreateTextFile(filename,true)
Set rs = Server.CreateObject("ADODB.Recordset")
strSql = "select * from exam_database"
Set rstData =conn.execute(strSql)
if not rstData.EOF and not rstData.BOF then
dim trLine,responsestr
strLine=""
For each x in rstData.fields
strLine = strLine & x.name & chr(9)
Next
myfile.writeline strLine
Do while Not rstData.EOF
strLine=""
for each x in rstData.Fields
strLine = strLine & x.value & chr(9)
next
myfile.writeline strLine
rstData.MoveNext
loop
end if
rstData.Close
set rstData = nothing
Conn.Close
Set Conn = nothing
Response.Write "<script>alert('生成EXCEL文件成功')</script>"
%>
</body>
</html>
谢 辞
首先,感谢高树风老师在毕业设计期间对我的支持和鼓励,在他的帮助和支持下使我较好的完成了毕业设计,这个项目已经接手一年整了,有过犹豫,有过无奈,但最终还是坚持下来了,这是与我的老师分不开的,其次是感谢我即将告别的母校,在即将告别这里的时候,一切都是那么熟悉,四年来,没有学校的老师们孜孜不倦的教诲就没有我今天的能力,我深爱在着这里。四年前,清涩的我踏上了这片土地,那时的她还依然那么安静,四年后,当我挥手告别她的时候,她已经学子遍地,亲爱的母校,亲爱的老师们,我深爱着北理工,深爱着这里的一切,无论走道何处,我永远都不会忘记你们。 << 上一页 [11]
基于B/S结构的MIS课程网上考试系统的设计与实现 第11页下载如图片无法显示或论文不完整,请联系qq752018766