<% @Language = VBScript%> <%
'--- linked databases Start Dim strConnStringstrConnString = "driver = {SQL Server}; server = songhp; uid = sa; pwd =; database = XVZDemo" set Conn = Server.CreateObject ( "ADODB.Connection") Conn.Open strConnstring '--- End Link Database
'--- the beginning of the assignment Dim SelectSql input parameters, SelectRs Dim SelectID, SelectName, SelectReturnSelectSql = "Select Max (CompanyID) From Dim_Company" Set SelectRs = Conn.Execute (SelectSql) SelectID = SelectRs (0)' --- End to Enter parameter assignment
DIM TIGGERTYPETIGGERTYPE = 3
Set cmd = server.createObject ("adoDb.command") set cmd.activeconnection = conncmd.commandtype = 4 '--- Declare this process for stored procedures
If tiggertype = 1 THEN '--- Starting a stored procedure for input parameters CMD.CommandText = "Transcompany1" set cmdparam = cmd.createParameter ("@ TRANSID", 3, 1) cmd.parameters.Append cmdparam cmd ("@ Transid ") = selectid cmd.execute '--- The stored procedure of the end of an input parameter call Elseif Tiggertype = 2 THEN
'--- Start an input parameter, a stored procedure called cmd.commandtext = "Transcompany2" set cmdparamid = cmd.createparameter ("@ Transid", 3, 1) cmd.parameters.Append cmdparamid cmd ("@ Transid) ") = Selectid set cmdparamname = cmd.createParameter (" @ Transname ", 202, 2, 50) cmd.parameters.Append cmdparamname cmd.execute select selectname = cmd (" @ transname ") '--- End an input parameter, one Stored procedure call for output parameters
Elseif Tiggertype = 3 THEN
'--- Start an input parameter, an output parameter, a returned value stored process call cmd.commandtext = "transcompany3" set cmdparamreturn = cmd.createParameter ("Return_Value", 3, 4) cmd.Parameters.Append CMDParamReturn set cmdparamid = Cmd.createParameter ("@ Transid", 3, 1) cmd.parameters.Append cmdparamid cmd ("@ TRANSID") = selectid set cmdparamname = cmd.createParameter ("@ transname", 202, 2, 50) cmd.parameters .Append cmdparamname cmd.execute selectname = cmd ("@ transname") Selectreturn = cmd ("Return_Value") '--- End an input parameter, an output parameter, a returned value stored procedure calling END IF
Conn.closset conn = Nothingset cmd = Nothingset cmdparamid = Nothingset cmdparamname = nothingset cmdparamreturn = Nothing
%>