博客
关于我
ASP查询数据RS转换成COMMAND
阅读量:433 次
发布时间:2019-03-06

本文共 1385 字,大约阅读时间需要 4 分钟。

RS版本:
IF(troubleCatalog="1" or troubleCatalog="2" or troubleCatalog="3" or troubleCatalog="4" or troubleCatalog="5" or troubleCatalog="6" or troubleCatalog="7" or troubleCatalog="8" or troubleCatalog="9" or troubleCatalog="10" or troubleCatalog="11" or troubleCatalog="12" or troubleCatalog="13" or troubleCatalog="164") Then
    sql="select dom_name from domainlist where dom_name='"&productName&"' and d_owner = "&mazey

    conn.open

    rs.open sql,conn,1,1 
    If Not rs.eof Then
        rs.close
        conn.close
    Else
        rs.close 
        conn.close
        returnErr "mazey"
        response.end
    End if
End If 
 
COMMAND版本:
IF(troubleCatalog="1" or troubleCatalog="2" or troubleCatalog="3" or troubleCatalog="4" or troubleCatalog="5" or troubleCatalog="6" or troubleCatalog="7" or troubleCatalog="8" or troubleCatalog="9" or troubleCatalog="10" or troubleCatalog="11" or troubleCatalog="12" or troubleCatalog="13" or troubleCatalog="164") Then
    sql="select dom_name from domainlist where dom_name='"&productName&"' and d_owner = "&mazey
    conn.open

    Set cmd=Server.CreateObject("adodb.Command")

    set cmd.ActiveConnection=conn

    cmd.CommandText=sql

    cmd.CommandType=1

    cmd.Parameters.Append cmd.CreateParameter("dom_name",200,1,64,dom_name)

    set rs=cmd.execute()

    set cmd.ActiveConnection=nothing

    set cmd=nothing

    If Not rs.eof Then
        conn.close
    Else
        conn.close
        returnErr "mazey"
        response.end
    End if
End If
Error:
Modify:
ADD conn.close After IF...ELSE... 

 

转载地址:http://jpmyz.baihongyu.com/

你可能感兴趣的文章
控制文件
查看>>
Oracle text组件安装
查看>>
Oracle 10g安装报错记录
查看>>
ConcurrentHashMap 源码分析
查看>>
在不影响程序使用的情况下添加shellcode
查看>>
刷LeetCode的简易姿势
查看>>
test!
查看>>
从零开始实现放置游戏(十五)——实现战斗挂机(6)在线打怪练级
查看>>
JavaScript 构造树形结构的一种高效算法
查看>>
通过Attached Property给控件绑定Command(二)
查看>>
Linq使用心得——SelectMany替代二重foreach循环
查看>>
UWP开发入门(二)——RelativePanel
查看>>
UWP开发入门(三)——{x:Bind}扩展标记
查看>>
微信小程序开发技巧总结 (一)-- 数据传递和存储
查看>>
Mac M1原生(ARM64)Golang dev&debug
查看>>
dock基本使用
查看>>
细说ASP.NET Core与OWIN的关系
查看>>
查看.NET Core源代码通过Autofac实现依赖注入到Controller属性
查看>>
.Net Core中使用ref和Span<T>提高程序性能
查看>>
ASP查询数据RS转换成COMMAND
查看>>