我在一个asp页面中得到了值 但是 当我再另一个页面中调用这个asp并输出的时候却出现错误 说未定义?

来源:百度知道 编辑:UC知道 时间:2024/05/31 07:04:28
Dim RRs,Report_1,Report_2,Report_3,Report_4
Set RRs=Conn.Execute("Select Top 1 R_1,R_2,R_3,R_4 From [China_Report] Where adid="&id)
If Not RRs.Eof Then
Report_1=RRs(0)
Report_2=RRs(1)
Report_3=RRs(2)
Report_4=RRs(3)
response.Write(Report_1)
End If
这是在一个asp中从数据库中取得的值
当我再另一个页面中调用这个asp并<td class="type_1">[<A href="post.asp?action=1&id=<%=id%>">分类错误</A>]<font color="#008000"> (</font><font color="#FF0000"><script src="inc/head.asp">document.write(Report_1)</SCRIPT></font><font color="#008000">)</font> [<A href="post.asp?action=2&id=<%=id%>">重复信息</A>] <font color="#008000">(</font><font color="#FF0000"><script src="inc/head.asp">document.write(Report_2)</SCRIPT></font><font colo

你是不是 语法没用对啊 doucument的语法

document.write(Report_1)要改成
document.write("<% =Report_1 %>")

其它各处均以此类推即可。

Set RRs=Conn.Execute("Select Top 1 R_1,R_2,R_3,R_4 From [China_Report] Where adid="&id

给ID值了吗

这个记录存在吗?

这个记录可能不在

document.write 是js的语法,我不是很清楚。但变量未定义的问题所在是变量日作用域问题。很明显你在第一个asp页面定义的是局部变量,所以另一个页面不能用。