快捷搜索:  as  test  1111  test aNd 8=8  test++aNd+8=8  as++aNd+8=8  as aNd 8=8

和记娱乐备用:Asp调试存储过程



asp开拓bs架构的三层系统,对付中小布局的系统把营业逻辑放在sqlserver的存储历程里面是一个很好的实现措施,但这么做呈现了一个asp客户端和数据库存储历程之间共同调试的未方便.

实际开拓中我写了下面一个函数,自动把asp端传给数据库的参数掏出,自动天生相符sqlserver查询阐发器的规则的存储历程履行敕令串,放在textarea控件里,可以从页面直接复制到查询阐发器里进行存储历程调试,下面便是法度榜样.

‘==================================================================’

dim dsn‘数据源

dim storename‘存储历程名

dim con‘Connection工具

dim cmd‘Command工具

dim rs‘Recordset 工具

set con=server.createobject(“ADODB.Connection”)

con.open dsn

set cmd=se和记娱乐备用rver.createobject("ADODB.Command")

set cmd.ActiveConnection=Con

cmd.CommandText= storename

cmd.Commandtype=adCmdStoredProc

cmd.Parameters.Append cmd.CreateParameter("@State",adInteger,adParamInput,4)

cmd.Parameters.Append cmd.CreateParameter("@WhereT",adVarChar,adParamInput,200)

cmd.Parameters.Append cmd.CreateParameter("@BranchType",adVarChar,adParamInput,50)

cmd("@State") = 1

cmd("@WhereT")=”2”

cmd("@BranchType")=”3”

getpmt(cmd)‘获取存储历程的和记娱乐备用参数

set rs=server.CreateObject("adodb.recordset")

rs.CursorType =3

rs.LockType =3

rs.CursorLocation =3

set rs.Source =cmd

rs.Open

‘======================================================’

‘形成存储历程的函数

‘=======================’

‘输入参数 a= command工具

‘=======================’

sub getpmt(a)

b=a.CommandText

b=replace(b,"?","")

b=replace(b,",","")

b=replace(b,"}","")

b=replace(b,"{","")

b和记娱乐备用=replace(b," ","")

b=replace(b,"call","")

b=replace(b,"(","")

b=replace(b,")","")

Response.Write "

" & b & "

"

Response.Write ""

Response.Write b

for each element in a.parameters

c=element

c="'" & replace(c,"'","''") & "'"

d=d &vbcrlf和记娱乐备用 &element.name&和记娱乐备用"="& c &","

next

d=left(d,len(d)-1)

Response.Write d

Response.Write ""

end sub

免责声明:以上内容源自网络,版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。

您可能还会对下面的文章感兴趣: