熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

asp 入門教程-讀取數據庫信息並更新

2013-11-13 10:43:00  來源: .NET編程 

  <!#include File="connasp">
<%
Dim id
Dim RsSql
id = Replace(Trim(RequestQueryString("id"))"""")
If Session("id"&id)<>"" Then
 Set Rs = ServerCreateObject("ADODBRecordset")
 Sql = "Select * From News Where id="&id
 RsOpen SqlConn
 If RsEof And RsBof Then
  ResponseWrite("NoData")
 Else
  ResponseWrite("Dig")
  ResponseWrite("")
  ResponseWrite(Rs("Dig"))
 End If
Else
 Set Rs = ServerCreateObject("ADODBRecordset")
 Sql = "Select * From News Where id="&id
 RsOpen SqlConn
 If RsEof And RsBof Then
  ResponseWrite("NoData")
 Else
  Dim Dig
  Dig =Rs("Dig")
  Dig = Dig +
  Rs("Dig") = Dig
  RsUpdate
  RsClose
  Set Rs = Nothing
  Session("id"&id) = id
  ResponseWrite(Dig)
 End If
End If
%>


From:http://tw.wingwit.com/Article/program/net/201311/14358.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.