请yms123帮忙
请问版主yms123,你再帮我看看下面的代码,当执行时<!-- #include file="../include/conn.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<%
Dim xlsconn,strsource,xlbook,xlsheet,i, sundxDB
Dim myConn_Xsl,xlsrs,sql,objCmd
Set xlsconn = server.CreateObject("adodb.connection")
Set xlsrs = Server.CreateObject("Adodb.RecordSet")
sundxDB="../data/sp.xls"
myConn_Xsl="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(""&sundxDB&"") ;Extended Properties=Excel 8.0"
xlsconn.open myConn_Xsl
sql = "Select * from Sheet1"
xlsrs.open sql,xlsconn,1,3
if xlsrs.eof then
else
i=1
response.Write"<table border='1'>"
do while not xlsrs.eof
ygh=xlsrs("员工号")
dw=xlsrs("单位")
xm=xlsrs("姓名")
xb=xlsrs("性别")
csny=xlsrs("出生年月")
cjgzsj=xlsrs("参加工作时间")
jszc=xlsrs("技术职称")
byyx=xlsrs("毕业院校")
ks=xlsrs("科室")
%>
<TR>
<TD> <%=ygh%></TD>
<TD> <%=dw%></TD>
<TD> <%=xm%></TD>
<TD> <%=xb%></TD>
<TD> <%=csny%></TD>
<TD> <%=cjgzsj%></TD>
<TD> <%=jszc%></TD>
<TD> <%=byyx%></TD>
<TD> <%=ks%></TD>
</TR>
<%
sql="insert into info(员工号) values('"&ygh&"')"
conn.execute(sql)
i=i+1
xlsrs.MoveNext
Loop
response.write "</table>"
End If
xlsrs.close
xlsconn.close
Response.write "共导入<font color='red'>" & i-1 & "</font>条记录.<br>" & vbCrLf
set xlsrs=nothing
set xlsconn=nothing
%>
</body>
</html>
当执行上述代码时,提示如下错误信息,请问什么原因?麻烦您给看看,谢谢
技术信息(用于支持人员)
错误类型:
Microsoft VBScript 编译器错误 (0x800A0411)
名称重定义
/admin/admin_pldrzcx.asp, line 12, column 40
Dim xlsconn,strsource,xlbook,xlsheet,i, sundxDB
---------------------------------------^
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
POST 221 ??? /admin/admin_pldrzcx.asp
POST Data:
filepath=%B5%BC%C8%EB%B5%C4Excel%CE%C4%BC%FE%2F%BB%F9%B1%BE%D0%C5%CF%A2&act=upload&file1=F%3A%5C%C1%D9%EB%D4%C5%A9%D0%C5%C5%E0%D1%B5%B5%B5%B0%B8%B9%DC%C0%ED%CF%B5%CD%B3%5Cdata%5Csp.xls&Submit=%B5%BC%C . . .
时间:
2009年9月3日, 9:23:57
详细信息:
Microsoft 支持