ASP:看看那里出错了!(代码有点长)
错误类型: Microsoft VBScript 编译器错误 (0x800A0411)
名称重定义
/tuangou/www/conn.asp, line 3, column 4
dim conn
---^
看看我这段代码
1. conn.asp
<%
On Error Resume Next
dim conn
dim connstr
dim db
db="database/sjrx.asp"
Set conn = Server.CreateObject("ADODB.Connection")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&db&"")
conn.Open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "服务器正在维护,请稍后再试。"
Response.End
End If
sub CloseConn()
conn.close
set conn=nothing
end sub
....其它的略过了(主要列出ASp语句)
</script>
2.当前页面
<!--#include file="conn.asp"-->
<%
com_id=request("com_id")
if isnull("com_id") then com_id=""
id=request("id")
if isnull("id") then id=""
if com_id<>"" then
set rs = server.CreateObject ("adodb.recordset")
sql="select * from company where id="&com_id
rs.open sql,conn,1,1
if not rs.eof or not rs.bof then
conmanyname=rs("conmanyname")
lastlogintime1=rs("lastlogintime1")
calling=rs("calling")
Properity=rs("Properity")
registerFund=rs("registerFund")
employee=rs("employee")
end if
rs.close
set rs=nothing
end if
%>
<%
id=request("id")
if isnull("id") then id=""
if id<>"" then
set rs = server.CreateObject ("adodb.recordset")
sql="select * from jobs where id="&id
rs.open sql,conn,1,1
if not rs.eof or not rs.bof then
jobFunction1=rs("jobFunction1")
jobFunction2=rs("jobFunction2")
jobFunction3=rs("jobFunction3")
PosName=rs("PosName")
.....
Address=rs("Address")
post=rs("post")
TelFlag=rs("TelFlag")
EmailFlag=rs("EmailFlag")
vipflag=rs("vip")
end if
rs.close
set rs=nothing
end if
%>
<html>
<!--#include file="top2.asp"-->
<%
SQL="Select * from jobs where user_id="&com_id
Set Rs=Server.CreateObject("Adodb.Recordset")
'response.write sql
Rs.Open SQL,Conn,1,1
if not rof then
for i=1 to rs.recordcount
if Rs.EOF then exit for
%>
<A href="com_job_list.asp?id=<%=rs("id")%>&com_id=<%=com_id%>" class="yellow">·<%=rs("PosName")%></A>
<%Rs.MoveNext
next
end if
rs.close
set rs=nothing
%>
<%set rs = server.CreateObject ("adodb.recordset")
sql="select * from company where id="&session("com_id")
rs.open sql,conn,1,3
if rs("vip")=1 then
%>
<!--#include file="com_job_list10.asp" -->
<%else%>
<!--#include file="com_job_list100.asp" -->
<%
rs.close
set rs=nothing
end if
%>
<%
file=request("file")
if file="" then file="com_job_list10.asp"
Server.Execute(file)
%></td>
<!--#include file="end2.asp" -->
我就 是找不到那错了,高手给指点一下!我在实习期,麻烦啊!
把Conn.asp中的dim conn删除了吗?
我在其它页面中都引用了它,删除了不会出什么事吧!高手给个答案,谢谢啊!