id=request("id")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)}dbq="&server.mappath("../database/date.mdb")
exec="select * from bz where id="&id&""
set ors=server.createobject("adodb.recordset")
ors.open exec,conn,1,1
Dim img1,img2,img3
img1 = " "
img2 = " "
img3 = " "
If Not ors.eof Then
If oRs(3).value <>"" And Trim(oRs(3).value).length >0 Then
img1 = "<img src='bz/images/" &oRs(3).value &"' border='0' />"
End If
If oRs(4).value <>"" And Trim(oRs(4).value).length >0 Then
img2 = "<img src='bz/images/" &oRs(4).value &"' border='0' />"
End If
If oRs(5).value <>"" And Trim(oRs(5).value).length >0 Then
img3 = "<img src='bz/images/" &oRs(8).value &"' border='0' />"
End If
End If
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%response.write(img1)%></td>
<td><%response.write(img2)%></td>
<td><%response.write(img3)%></td>
</tr>
</table>
</body>
</html>
ASP没有判断空变量的函数,用IF语句<%
IF 记录集("字段")="" Then
Response.Write("空")
Else
Response.Write(记录集("字段"))
End IF
%>
如果是SQL查询语句用 IS NULL或IS NOT NULL
set rs=conn.execute(select * from table_name where user='"&user&"' and dl="&dl&" and pass='"&pass&"'")if rs.eof then
response.write("script>alert('未激活')</script>")
response.end
end if
这个只是给你的思路,你要检查你数据库的字段类型。。。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)