数据库调用表格

来源:百度知道 编辑:UC知道 时间:2024/05/16 08:39:27
我是用这种方式调用数据库内容的。

<iframe src="0000.asp?id=<%=rs("GoodID")%>" frameborder="0" scrolling="no" width="600" HEIGHT="50" frameborder=0 scrolling=no></iframe>

000.asp内容:
<!--#include file="conn.asp"-->
<!--#include file="inc/char.asp"-->
<%
ID=request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from BJX_goods where Goodid= " & ID & "",conn,1,3
%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td><font color="#666666"> 
<%
if len(trim(rs("Description")))>150 then
response.write left(trim(rs("Description")),120)&"..."
else
response.write trim(rs("Description"))
end if
%

<%
if len(trim(rs("Description")))>150 then
response.write left(trim(rs("Description")),120)&"..."
else
response.write trim(rs("Description"))
end if
%>
这段的第二条不是把语句截断了吗?如果这条语句太长,就取120字符,所以你取出来的数据不是完整的,延期就不能形成表格。