下面是一段简单的由asp导入excel数据保存到其它的数据如有mssql access mysql 等哦好了费话不说多了来看看下面的代码吧
<!#include file="adoconnasp">
<%
Set xlsconn = serverCreateObject("adodbconnection")
set rs=serverCreateObject("adodbrecordset")
source=servermappath("")&""&replace(request("path")"/""")
myConn_Xsl="Provider=MicrosoftJetOLEDB;Data Source=" &source& ";Extended Properties=Excel "
xlsconnopen myConn_Xsl
sql="select * from [商品列表$]"
set rs=xlsconnexecute(sql)
if not rseof then
while not rseof
names=rs("商品名")
pic=rs("图片")
sql="insert into [product](namesepic) values("& names &""& pic &")"
connexecute(sql)
rsmovenext
wend
end if
responsewrite "导入成功"
end if
%>
数据连接文件<!#include file="adoconnasp">
set rs=serverCreateObject("adodbrecordset")
db="/database/dbmdb"
set conn=serverCreateObject("adodbconnection")
connstr="Provider=MicrosoftJetOLEDB;Data Source=" & ServerMapPath(db)
connopen connstr