ASP excel导出/导入Access数据库(代码+实例下载)
Excel导出函数
<%
Sub ExportToExcel
Response.ContentType = "application/vnd.ms-Excel"
Response.AddHeader "Content-Disposition", "attachment;Filename=Results.xls"
Response.Write "<body>"
Response.Write "<table border=1>"
Call WriteTableData
Response.Write "</table>"
Response.Write "</body>"
Response.Write "</html>"
End Sub
%>
Excel导入数据库
<%
dim FileName
FileName="Excel.xls" '取得文件名,来自项目经理的指定,路径固定在某个虚拟路径中
Dim conn, rs
set conn=CreateObject("ADODB.connection")
conn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
"DriverId=790;" & _
"Dbq=" & Server.mappath(""&FileName&"") & ";" & _
"DefaultDir=G:\"
set rs=createobject("ADODB.recordset")
rs.Open "Select * from [Sheet1$]",conn, 2, 2
if rs.eof then
response.write "Excel表中无纪录"
else
set connDB = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("Excel.mdb")
'RESPONSE.WRITE DBpath
connDB.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Set RsDB = Server.CreateObject("ADODB.Recordset")
SQLDB="Select * from Excel"
RsDB.open SQLDB,connDB,1,3
do while not rs.eof '利用循环读出数据
RsDB.addnew
RsDB("filename")=rs(0)
RsDB("id1")=rs(1)
RsDB("id2")=rs(2)
RsDB("id3")=rs(3)
RsDB("id4")=rs(4)
Rs.update
RsDB.movenext
rs.movenext
loop
'response.redirect FileName
end if
RsDB.movefirst
if RsDB.eof then
response.write "数据库中无记录"
else
do while not RsDB.EOF
response.write RsDB("filename")&" "
response.write RsDB("id1")&" "
response.write RsDB("id2")&" "
response.write RsDB("id3")&" "
response.write RsDB("id4")&" "
re
相关文档:
您可以通过以下方法自定义多个 ASP.NET 登录控件的内容:指定控件模板并将自己的控件添加到控件的用户界面 (UI),或者替换或移除控件的用户界面不需要的可选控件。还可以使用登录控件的样式属性以及主题和外观来定制控件的外观。
一、可自定义的登录控件
对于可以使用模板替换 ......
这是一个经常被提出的问题,并且它很容易把人们带入争论Linux还是Windows的歧途。这样的争论事实上反映出了对于相互竞争的Web开发技术要进行并行分析是多么困难的一件事情,而这一难度同时因为开发人员对任何可比较操作系统的不同意见而大大增加。
所以与其继续参与到这样的争论中,我们还不如来看看每一项技术对 ......
1、分别安装三个环境,并设置不同端口
PHP:80
JSP:8080
ASP:8081
2、设置/Apache2/conf/httpd.conf
去掉以下三行前的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
加入以下几行: ......
<%
'日期函数包DataPackage
%>
<script language="javascript">
function IsDateString(Str)
<!--
{
// 校验是否YYYY-MM-DD格式的日期型数据,返回值为True成功,否则返回False
// 如果传递的是空字符串则返回False
// 定义分隔符
var sSplit="-"
var iYearPos=Str.indexOf(sSplit);
if (iYearP ......
方法一:
<%
' ============================================
' 格式化时间(显示)
' 参数:n_Flag
' 1:"yyyy-mm-dd hh:mm:ss"
' 2:"yyyy-mm-dd"
' 3:"hh:mm:ss"
' 4:"yyyy年mm月dd日"
' 5:"yyyymmdd"
' &nb ......