举手的秘密读后感:高手.帮看看这段ASP代码有什么错误!!

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 02:48:07
请先看这段代码<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试</title>
</head>
<body>
<% If request("username")="" Then %>
<% Response.Write "<script> window.alert('必须填写用户名!'); location.href='1.asp';</script>" %>
<% ElseIf request("password")="" Then %>
<% Response.Write"<script> window.alert('必须填写密码!'); location.href='1.asp';</script>" %>
<% Else %>
<% dim username,password
username=request.Form("username")
password=request.Form("password")
set rs=server.createobject("adodb.recordset")
sql="select * from user where username='"&username&"'"
rs.open sql,conn,1,1
If rs.bof and rs.eof Then
Response.Write"<script> window.alert('没有此用户!'); location.href='1.asp';</script>"
ElseIf rs("password")<>password Then
Response.Write"<script> window.alert('密码错误!'); location.href='1.asp';</script>"
Else
Response.Write"<script> window.alert('"&username&"您好! 欢迎进入系统!');</script>"

Response.Write"<table width='200' height='200' border='1' align='center'>
<%do while not rs.eof%>
<tr>
<td width='69' align='center'>用户名</td>
<td width='115'><%=rs("username")%></td>
</tr>
<tr>
<td align=center>早上事情</td>
<td><%=rs("amdo")%></td>
</tr>
<tr>
<td align=center>下午事情</td>
<td><%=rs("pmdo")%></td>
</tr>
<tr>
<td align=center>晚上事情</td>
<td><%=rs("evedo")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>"
End If
%>
<% End If %>
</body>
</html>

代码就是这样的..........帮看看有什么错误谢谢拉估计问题出在这段代码上Response.Write"<table width='200' height='200' border='1' align='center'>
<%do while not rs.eof%>
<tr>
<td width='69' align='center'>用户名</td>
<td width='115'><%=rs("username")%></td>
</tr>
<tr>
<td align=center>早上事情</td>
<td><%=rs("amdo")%></td>
</tr>
<tr>
<td align=center>下午事情</td>
<td><%=rs("pmdo")%></td>
</tr>
<tr>
<td align=center>晚上事情</td>
<td><%=rs("evedo")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>"
因为我添加了这段代码它就说Microsoft VBScript 编译器错误 '800a0409'

未结束的字符串常量

\wwwroot\mysite\2.asp, line 27

Response.Write"<table width='200' height='200' border='1' align='center'> "

最后要有结束的双引号!!!

改为Response.Write"<table width=200 height=200 border=1 align=center>" %>式一下

缺少%>结束符