?
快捷搜索:  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

免責聲明:以上內容源自網絡,版權歸原作者所有,如有侵犯您的原創版權請告知,我們將盡快刪除相關內容。

您可能還會對下面的文章感興趣:

快三平台开户