用Access制作一个功能完善的论坛(源程序)
敬业的IT人
互联网
佚名
2008-4-14 17:10:44
To view a live demonstration of this forum, click View Demo.
To create this forum>
<frame frameborder="no" scrolling="no" src="http://www.cncms.com.cn/asp/discusslogo.asp" marginheight=2 marginwidth=5>
<frame name="topframe" src="http://www.cncms.com.cn/asp/discussframes.asp">
</frameset>
</html>
-----------------------------------------
Listing 2.0 - discussframes.asp
-------------------------------------------------
<!-- #INCLUDE FILE="discussfuncs.asp" -->
<%
page = TRIM( request( "pg" ) )
addm = TRIM( request( "addm" ) )
email = TRIM( request( "email" ) )
subject = TRIM( request( "subject" ) )
message = TRIM( request( "message" ) )
IF addm <> "" THEN
IF email = "" THEN
showError "You did not enter your email address", "post.asp"
END IF
IF subject = "" THEN
showError "You did not enter a subject for your message", "post.asp"
END IF
IF message = "" THEN
showError "You did not enter a message", "post.asp"
END IF
IF INSTR( email, "." ) = 0 OR INSTR( email, "@" ) = 0 THEN
showError "You did not enter a valid email address", "post.asp"
END IF
readyDBCon
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
RS.Open "SELECT * FROM messages WHERE 1<>1", Con
RS.AddNew
RS( "m_email" ) = email
RS( "m_subject" ) = subject
RS( "m_message" ) = message
RS( "m_reply" ) = addm
RS.Update
RS.Close
IF addm <> "-1" THEN
Con.Execute "UPDATE messages SET m_numreplies = m_numreplies+1 WHERE m_id=" & addm
END IF
END IF
%>
<html>
<head><title>frameset</title>
<frameset rows="300,*">
<frame marginheight="3" marginwidth="5" frameborder="no" scrolling="yes" src="http://www.cncms.com.cn/asp/messagelist.asp?
pg=<%=page%>">
<frame name="message" marginwidth="0" marginheight="0" frameborder="no" scrolling="auto"
src="http://www.cncms.com.cn/asp/message.asp?id=<%=addm%>&pg=<%=page%>">
</frameset>
</html>
------------------------------------------------------
Listing 3.0 - discussfuncs.asp
-------------------------------------------------------
<%
dbPath = "d:\discuss.mdb"
messagesApage = 5
''''''''''''''''''''
' Define Constants
''''''''''''''''''''
adOpenStatic = 3
adLockOptimistic = 3
'''''''''''''''''''''''''''
' Declare Global Variables
'''''''''''''''''''''''''''
DIM Con
SUB readyDBCon
IF Con = "" THEN
Set Con = Server.CreateObject( "adodb.Connection" )
To create this forum>
<frame frameborder="no" scrolling="no" src="http://www.cncms.com.cn/asp/discusslogo.asp" marginheight=2 marginwidth=5>
<frame name="topframe" src="http://www.cncms.com.cn/asp/discussframes.asp">
</frameset>
</html>
-----------------------------------------
Listing 2.0 - discussframes.asp
-------------------------------------------------
<!-- #INCLUDE FILE="discussfuncs.asp" -->
<%
page = TRIM( request( "pg" ) )
addm = TRIM( request( "addm" ) )
email = TRIM( request( "email" ) )
subject = TRIM( request( "subject" ) )
message = TRIM( request( "message" ) )
IF addm <> "" THEN
IF email = "" THEN
showError "You did not enter your email address", "post.asp"
END IF
IF subject = "" THEN
showError "You did not enter a subject for your message", "post.asp"
END IF
IF message = "" THEN
showError "You did not enter a message", "post.asp"
END IF
IF INSTR( email, "." ) = 0 OR INSTR( email, "@" ) = 0 THEN
showError "You did not enter a valid email address", "post.asp"
END IF
readyDBCon
Set RS = Server.CreateObject( "ADODB.Recordset" )
RS.ActiveConnection = Con
RS.CursorType = adOpenStatic
RS.LockType = adLockOptimistic
RS.Open "SELECT * FROM messages WHERE 1<>1", Con
RS.AddNew
RS( "m_email" ) = email
RS( "m_subject" ) = subject
RS( "m_message" ) = message
RS( "m_reply" ) = addm
RS.Update
RS.Close
IF addm <> "-1" THEN
Con.Execute "UPDATE messages SET m_numreplies = m_numreplies+1 WHERE m_id=" & addm
END IF
END IF
%>
<html>
<head><title>frameset</title>
<frameset rows="300,*">
<frame marginheight="3" marginwidth="5" frameborder="no" scrolling="yes" src="http://www.cncms.com.cn/asp/messagelist.asp?
pg=<%=page%>">
<frame name="message" marginwidth="0" marginheight="0" frameborder="no" scrolling="auto"
src="http://www.cncms.com.cn/asp/message.asp?id=<%=addm%>&pg=<%=page%>">
</frameset>
</html>
------------------------------------------------------
Listing 3.0 - discussfuncs.asp
-------------------------------------------------------
<%
dbPath = "d:\discuss.mdb"
messagesApage = 5
''''''''''''''''''''
' Define Constants
''''''''''''''''''''
adOpenStatic = 3
adLockOptimistic = 3
'''''''''''''''''''''''''''
' Declare Global Variables
'''''''''''''''''''''''''''
DIM Con
SUB readyDBCon
IF Con = "" THEN
Set Con = Server.CreateObject( "adodb.Connection" )
- 最新文章
- 广告播放和跟踪系统的制作[04-14]
- 动态广告管理程序制作例子[04-14]
- 深入研究“用ASP上载文件”(一)[04-14]
- 深入研究“用ASP上载文件”(二)[04-14]
- 一个投票系统的源程序(coveryourasp.com)[04-14]
- 一 些 ASP 小 源 程 序[04-14]
- 相关文章
- 通过ASP与ACCESS数据库建立连接(附源码)(1)[04-14]
- 通过ASP与ACCESS数据库建立连接(附源码)(2)[04-14]
- 通过ASP与ACCESS数据库建立连接(附源码)(3)[04-14]
- 基于ACCESS数据库的纯asp论坛制作心得[04-14]
- 利用ASP和Access数据库制作局域网网上答题系统[04-14]
- 纯编码实现Access数据库的建立或压缩[04-14]
