zoukankan      html  css  js  c++  java
  • 如何调用上一篇数据处理函数ActionDB?


    <%
    ' 首先要确定数据库连接字符串Application("connstr") ,当然你在ActionDB函数中确定也行
    '  Access 数据库连接字符串
    Application("connstr") = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("YourAccessDB.Mdb")
    '  SQL Server2000 数据库连接字符串
    '  Application("connstr") = "provider=sqloledb;data source=localhost;initial catalog=YourDataBase;user id=sa;password=;" 

      Dim strSQL, arrList
      Dim i
      Dim hasList
      Dim intID, strTitle,  strContent 
     
      ' 读取数据
      strSQL = "Select *  From YourTable"
      If ActionDB(strSQL, arrList, 1) then
          hasList = True
      End If
      If hasList then
         For i=0 To Ubound(arrList, 2)
             Response.write arrList(0, i) & "|" & arrList(1, i) & arrList(2, i) & "<br>"  ' 第i行的字段内容
         Next
      Else
         Response.write "暂时没有数据!"
      End If
       
      '增加或者删除数据
       strSQL = "Insert Into YourTable(Tiletle, Content) Values('"& strTitle &"','" & strContent & "')  '增加
       'strSQL = "Delete  From YourTable where ID=" & intID ' 删除
       If ActionDB(strSQL, arrList, 0) then
           Respose.Write "增加(或者删除)数据成功!"
       else
           Respose.Write "增加(或者删除)数据失败!"
      End If
     %>
       
     
  • 相关阅读:
    GIS开发站点收藏
    读取Excel中的数据到DataSet
    SPSS统计功能与模块对照表
    相关性分析主要源码
    Matlab典型论坛
    EasyUI入门视频教程
    利用EF ORM Mysql实体运行程序出错解决方案
    小议
    六、 从Controller中访问模板数据(ASP.NET MVC5 系列)
    五、 创建连接串连接本地数据库(ASP.NET MVC5 系列)
  • 原文地址:https://www.cnblogs.com/stronger/p/207461.html
Copyright © 2011-2022 走看看