兄弟,很多的啊
不过我看主要就是这些
<%
i=1
Dim ArrayBigClassID(20),ArrayBigClassName(20),ArrayBigClassImg(20)
while not rs.EOF
RecordCount=rs.RecordCount
BigClassID=rs("BigClassID")
BigClassName=trim(rs("BigClassName"))
BigClassImg=trim(rs("BigClassImg"))
ArrayBigClassID(i)=BigClassID
ArrayBigClassName(i)=BigClassName
ArrayBigClassImg(i)=BigClassImg
i=i+1
rs.MoveNext
wend
rs.close
%>
<%
set rs3=server.CreateObject("ADODB.RecordSet")
for i=1 to RecordCount
BigClassID=ArrayBigClassID(i)
BigClassName=ArrayBigClassName(i)
BigClassImg=ArrayBigClassImg(i)
%>
<%
rs3.Source="select top 10 NewsID,Title,UpdateTime,BigClassName,SmallClassName,SpecialID,click from News where BigClassName='" & BigClassName &"' order by NewsID DESC"
rs3.Open rs3.Source,conn,1,1
while not rs3.EOF
'定义标题显示限制
Title=trim(rs3("Title"))
TitleLen=len(Title)
If TitleLen<21 then
Response.Write "
" %> &BigClassName=<%=rs3("BigClassName")%>&SmallClassName=<%=rs3("SmallClassName")%>&SpecialID=<%=rs3("SpecialId")%>" target="_blank"><%=Title %>(<%=Month(rs3("UpdateTime")) %>月<%=Day(rs3("UpdateTime")) %>日)[<%=rs3("click") %>]
<% Response.Write " |
"
else
DisplayTitle=mid(Title,1,21)
Response.Write "
" %> &BigClassName=<%=rs3("BigClassName")%>&SmallClassName=<%=rs3("SmallClassName")%>&SpecialID=<%=rs3("SpecialId")%>" target="_blank"><%=displaytitle%>...(<%=Month(rs3("UpdateTime")) %>月<%=Day(rs3("UpdateTime")) %>日)[<%=rs3("click") %>]
<% Response.Write " |
"
end if
rs3.MoveNext
wend
rs3.close
%>
include的conn.asp
<%
StrSQL="DBQ="+server.mappath("admin/data/newsxp.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
'StrSQL="DSN=news;"
set conn=server.createobject("ADODB.CONNECTION")
conn.open StrSQL
%>
include的投票系统里面的:
<%
for id = 1 to 2
Sql = "Select * From voteform Where ID_F='" & id & "'"
Set rs = Conn.Execute (Sql)
%>
<%
next
rs.close
Set rs = nothing
Set conn = nothing
%>
include里面include的一个conn1.asp
<%
Set conn = Server.CreateObject ("ADODB.Connection")
'ODBC 方式
'conn.ConnectionString = "user_confirm"
'conn.Open
'绝对路径方式
conn.Open "Dbq=" & Server.MapPath("/news/newsxp/vote/vote.mdb") &";Driver=Microsoft Access Driver (*.mdb)"
Set rs = Server.CreateObject ("ADODB.Recordset")
%>
辛苦了:)