-
使用高效率的sql语句优化asp代码 - [有关ASP程序方面的]
2008-03-14
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://muf2004.blogbus.com/logs/16991526.html
首先要建立连接:
dim conntol,ServerName,UName,Upwd,DataName
ServerName="zhj" '服务器名字
UName="sa" '用户名
Upwd="sa" '密码
DataName="ga_data" '数据库名字
conntol = "driver={SQL Server};server="&ServerName&";uid="&UName&";pwd="&Upwd&";database="&DataName
set conn=server.createobject("adodb.connection")
conn.open conntol增加记录用:
conn.execute("insert into ga_inf(inf_bigclass,inf_title,inf_author,inf_keyword,inf_content,inf_date) values("&infBigclass&",'"&infTitle&"','"&infAuthor&"','"&infKeyword&"','"&infContent&"
','"&infDate&"')")修改记录用:
conn.execute("update ga_inf set inf_bigclass="&UinfBigclass&",inf_title='"&UinfTitle&"',inf
_author='"&UinfAuthor&"',inf_keyword='"&UinfKeyword&"',inf_content='"&UinfContent
&"',inf_date='"&UinfDate&"' where inf_id="&int(UinfId)&"")删除记录用:
conn.execute("delete from ga_inf where inf_id in("&int(request.Form("inf_Del"))&")")
简单的选择记录用:
set rs=conn.execute("select inf_bigclass,inf_title,inf_author,inf_keyword,inf_content,inf_date from ga_
inf where inf_id="&EinfId&"")只有需要列表的记录才用:
sql="select inf_id,inf_title,inf_bigclass,inf_date from ga_inf order by inf_date desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1历史上的今天:
先加载网页,然后再加载广告 让AD代码不再影响你的网页加载速度 2008-03-14asp实现批量录入数据的实现 2008-03-14精妙SQL语句 2008-03-14ASP实用函数库源码 2008-03-14避免asp的SQL的执行效率低 2008-03-14随机文章:
ASP连接SQL Server2005 2008-08-02SQL语句优化 攻略 2008-03-14易天企业型后台管理系统V3.0版,终于出来了! 2008-01-09易天通用企业型后台管理系统V3.0版,终于要出来了! 2008-01-06招域名空间代理,价格优惠50元100M全能空间 2009-06-27
收藏到:Del.icio.us







