首页 > 网站 > 建站经验 > 正文

asp 入门教_程-读取数据库信息并更新

2019-11-02 15:15:19
字体:
来源:转载
供稿:网友

<!--#include File="conn.asp"-->
<%
Dim id
Dim Rs,Sql
id = Replace(Trim(Request.QueryString("id")),"'","")
If Session("id"&id)<>"" Then
 Set Rs = Server.CreateObject("ADODB.Recordset")
 Sql = "Select * From News Where id="&id
 Rs.Open Sql,Conn,3,3
 If Rs.Eof And Rs.Bof Then
  Response.Write("NoData")
 Else
  Response.Write("Dig")
  Response.Write(",")
  Response.Write(Rs("Dig"))
 End If
Else
 Set Rs = Server.CreateObject("ADODB.Recordset")
 Sql = "Select * From News Where id="&id
 Rs.Open Sql,Conn,3,3
 If Rs.Eof And Rs.Bof Then
  Response.Write("NoData")
 Else
  Dim Dig
  Dig =Rs("Dig")
&nb

CK电影网[www.aikan.tv/special/ckdianyingwang/]
sp; Dig = Dig + 1
  Rs("Dig") = Dig
  Rs.Update
  Rs.Close
  Set Rs = Nothing
  Session("id"&id) = id
  Response.Write(Dig)
 End If
End If
%>

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表