显示记录

从数据库中提取记录,比如记录<%rs=subject%>有20个字符,我只想显示10个,其后的只用一个...代替。
示例:1234567890abcdefghij处理后变成1234567890...。谢谢!
---------------------------------------------------------------

left(rs("subject"),10)&"..."

---------------------------------------------------------------

str=mid(cstr(rs("subject")),1,10) & "..."
---------------------------------------------------------------

1 sql="select * from message"   
2set rs=server.createobject("adodb.recordset")   
3rs.open sql,conn,3,3   
4do while not rs.eof
1=left(rs("subject"),10)
1rs.movenext   
2loop   
3rs.close   
4set rs=nothing   

---------------------------------------------------------------

1 sql="select * from message"   
2set rs=server.createobject("adodb.recordset")   
3rs.open sql,conn,3,3   
4do while not rs.eof   
5str=rs("subject")   
6str= left(str,10) & "..."
1=str
1rs.movenext   
2loop   
3rs.close   
4set rs=nothing   
Published At
Categories with Web编程
comments powered by Disqus