关于只显示数据库中的一个表里的前几个字的问题
我好象记得有人问过,但我找不到了,大家帮下忙吧~!我的全部代码是这样写的,改完再全部发一次,本人是一文盲。谢谢了
Sub Index_News()
Set Rs=Server.CreateObject( "Adodb.RecordSet ")
Sql= "select Top " & NewsMax_Index & " * from Tx_News where News_Flag=1 and News_Index=1 and News_ClassId=8 order by News_Date desc "
Rs.Open sql,Conn,1,1
IF Rs.recordCount=0 THEN
Call Page_check(4,0)
Else
While Not Rs.Eof
Response.Write " <DIV STYLE= 'height: 25px;text-align: left; '> <SPAN STYLE= 'width: 200px;padding-left: 8px; '> <IMG SRC= 'Skins/Blue _Ar4.gif '> <A HREF= 'News.asp?Id= " & Rs( "News_Id ") & " ' title= '信息主题: " & Rs( "News_Title ") & " 添加时间: " & YearDa(Rs( "News_Date ")) & " '> " & gotTopic(Rs( "News_Title "),26,1) & " </SPAN> </A> <SPAN CLASS= 'type-color2 ' STYLE= 'width: 80px;text-align:center; '> " & Rs( "News_Count ") & " </SPAN> <SPAN STYLE= 'color:#999999; '> " & YearDa(Rs( "News_Date ")) & " </SPAN> </DIV> "
Rs.MoveNext
Wend
End IF
Rs.close
Set Rs=Nothing
End Sub
------解决方案--------------------Sub Index_News()
Set Rs=Server.CreateObject( "Adodb.RecordSet ")
Sql= "select Top " & NewsMax_Index & " * from Tx_News where News_Flag=1 and News_Index=1 and News_ClassId=8 order by News_Date desc "
Rs.Open sql,Conn,1,1
IF Rs.recordCount=0 THEN
Call Page_check(4,0)
Else
While Not Rs.Eof
Response.Write " <DIV STYLE= 'height: 25px;text-align: left; '> <SPAN STYLE= 'width: 200px;padding-left: 8px; '> <IMG SRC= 'Skins/Blue _Ar4.gif '> <A HREF= 'News.asp?Id= " & Rs( "News_Id ") & " ' title= '信息主题: " & Rs( "News_Title ") & " 添加时间: " & YearDa(Rs( "News_Date ")) & " '> " & GetLeftString(Rs( "News_Title "),10) & " </SPAN> </A> <SPAN CLASS= 'type-color2 ' STYLE= 'width: 80px;text-align:center; '> " & Rs( "News_Count ") & " </SPAN> <SPAN STYLE= 'color:#999999; '> " & YearDa(Rs( "News_Date ")) & " </SPAN> </DIV> "
Rs.MoveNext
Wend
End IF
Rs.close
Set Rs=Nothing
End Sub