首页 | 培训 | 求学 | 参考 | 教师 | 教材 | 学校 | 招聘 | 租房 | 旅游ASKEDU.com  


培训指南—ASKEDU.com

返回 | 主页


使用ASP、VB和XML建立运行于互联网上的应用程序6



[摘要]
’打开连结
   set conn = Server.CreateObject("ADODB.Connection")
   conn.Mode=adModeReadWrite
   conn.open Application("ConnectionString")
   if err.number <> 0 the...

’打开连结
   set conn = Server.CreateObject("ADODB.Connection")
   conn.Mode=adModeReadWrite
   conn.open Application("ConnectionString")
   if err.number <> 0 then
    call responseError("连结出错: " & Err.Description)
    Response.end
   end if

  ’ 连结Command对象
  set cm.ActiveConnection = conn

  ’ 执行命令
  if returnsData then
   ’ 用命令打开一个Recordset
    set R = server.CreateObject("ADODB.Recordset")
    R.CursorLocation = adUseClient
    R.Open cm,,adOpenStatic,adLockReadOnly
  else
    cm.Execute recordsAffected, ,adExecuteNoRecords
  end if
   if err.number <> 0 then
    call responseError("执行命令错误 ’" & Commandtext & "’: " & Err.Description)
    Response.end
   end if

   if returnsData then
    R.Save Response, adPersistXML
    if err.number <> 0 then
     call responseError("数据集发生存储错误,在命令’" & CommandText & "’: " & Err.Description)
     Response.end
    end if
   elseif returnsValues then
    sXML = "<?xml version=""1.0"" encoding=""gb2312""?>" & vbcrlf & "<values>"
    set nodes = xml.selectNodes("command/param[direction=’2’]")
    for each N in nodes
     nodeName = N.selectSingleNode("name").text
     sXML = sXML & "<" & nodename & ">" & cm.Parameters(nodename).Value & "" & "</" & nodename & ">"
     next
     sXML = sXML & "</values>"
     Response.Write sXML
   end if

   set cm = nothing
   conn.Close
   set R = nothing
   set conn = nothing
   Response.end
  %>


其它培训参考信息:
使用ASP、VB和XML建立运行于互联网上的应用程序5
使用ASP、VB和XML建立运行于互联网上的应用程序4
使用ASP、VB和XML建立运行于互联网上的应用程序3
使用ASP、VB和XML建立运行于互联网上的应用程序2
使用ASP、VB和XML建立运行于互联网上的应用程序1
浅谈数据库的攻击(数据库扫描工具)
浅谈数据库的攻击(数据库里如何留后门)
浅谈数据库的攻击(数据库的利用)



信息来自互联网,敬请核实,谨慎使用



 




  中国 | Worldwide: United States United Kingdom Australia Canada India | Travel AgencyASKEDU.com