首页 | 心情日记 | 建站心得 | 编程技术 | 大盘分析 | 股市信息 | 学习园地 | 电脑技巧 | 物流外贸 | 另类其它 | 站长推荐 | 给我留言 | 相册

用户登陆
用户:
密码:
 
不保存保存一天
保存一月保存一年

站点日历
73 2024 - 4 48
 123456
78910111213
14151617181920
21222324252627
282930


站点统计

最新评论

日志搜索

 标题   内容


数据库受到限制怎么办? 经典实用的基础asp程序整理
未知 ASP程序实现网页伪静态页源代码   [ 日期:2009-09-03 17:24:54 ]   [ 来自:本站原创 ]

海外邮件中继,海外退信中继,美国高速VPS,不限流量VPN,邮局维护和管理,邮件网关,EMOS邮件中继,POSTFIX邮件中继,Winwebmail邮件中继,Winmail邮件中继,DBMail邮件中继,JDMail邮件中继,Exchange邮件中继,MDaemon邮件中继 淘宝店:http://shantan.taobao.com 云邮科技官网:www.yunrelay.com

【字体设置:
一、数据库很简单使用ACCESS,Data.mdb建立一个表Article,三个字段:ID,Title,Content;自动编号、标题、文章内容。
二、Config.asp
ASP/Visual Basic代码
以下为引用的内容:
<% 
'数据库链接 
db="data.mdb" 
Set conn = Server.CreateObject("ADODB.Connection") 
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db) 
conn.open connstr
If Err Then 
err.Clear 
Set conn = Nothing 
Response.Write "数据库连接出错,请检查连接字串。" 
Response.End 
End If
'定义新闻阅读界面的读取
Dim News_title,News_content 
Sub ReadNews() 
set rs1=server.createobject("adodb.recordset") 
sql1="select id,title,content from article where id="& ID 
rs1.open sql1,conn,3,3 
News_title=rs1("title") 
News_content=rs1("content") 
rs1.close 
set rs1=Nothing 
End Sub 
%> 
三、Default.asp
以下为引用的内容:
ASP/Visual Basic代码
<!--#include file="config.asp"--> 
<ol> 
<% 
Set rs=server.CreateObject("adodb.recordset") 
sql="select * from Article" 
rs.open sql,conn,1,1 
do while not rs.eof 
%> 
<li><a href="article.asp?/<%=rs("id")%>.html"><%=left(trim(rs("title")),30)%></a></li> 
<% 
rs.movenext 
loop 
rs.close 
set rs=Nothing 
%> 
</ol> 
四、Article.asp 
ASP/Visual Basic代码
以下为引用的内容:
<!--#include file="config.asp"--> 
<% 
id=request.QueryString("id") 
If id="" Then 
server_v40=Request.ServerVariables("QUERY_STRING") 
id=Int(replace(replace(server_v40,"/",""),".html","")) 
End If 
Call ReadNews() 
%> 
<div> 
标题: <b><%= News_title%></b><br /> 
内容: <%=News_content%> 
</div> 
这个教程已经能实现最基本的功能,具体大家就想怎么应用就八仙过海,各显神通了!

暂时没有评论
   发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:  我要注册 验证码: 
为防止广告注册机程序,验证码不会自动显示,请点击此处显示或者(刷新)验证码!
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字
确定发布?
最多可以输入200个字,目前你已经输入了0个字;你今日还可以发表10条评论!
 
   

CopyRight © 2008-2010 广东金融学院030904班 All Rights Reserved
Powered by www.030904.com