本文介绍了具有输入输出参数的CORE ASP调用存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 这是mysql 例程(存储过程)......This is mysql routine(store procedure)...-- ---------------------------------------------------------------------------------- Routine DDL-- Note: comments before and after the routine body will not be stored by the server-- --------------------------------------------------------------------------------DELIMITER $$CREATE DEFINER=`root`@`localhost` PROCEDURE `InUser`(IN Id INTEGER,In UId Integer,In UIdTo Integer,out R_Id Integer)BEGINIF Id = 0 THENinsert into test.mainselect (SELECT COALESCE(max(test.main.Id),0)+1 FROM test.main) as id,UId as uid;insert into test.mainselect (SELECT max(test.main.Id) FROM test.main) as id,UIdTo as uid;set R_Id = (select max(id) from test.main);Elseinsert into test.mainselect test.main.Id as id,UIdTo as uid;set R_Id = (select max(test.main.id) from test.main);End If;END ASP代码如下...ASP CODE is as below...<html><body><form > <% MsgBox "Hello, World!" on error resume next Set OBJdbConnection1 = Server.CreateObject("ADODB.Connection") OBJdbConnection1.ConnectionTimeout = Session("ConnectionTimeout") OBJdbConnection1.CommandTimeout = Session("CommandTimeout") OBJdbConnection1.Open Session("ConnectionString") dim Uid,Id Uid = 1'request.form("Uid") Id = 0'request.form("Id") Set SQLStmt1 = Server.CreateObject("ADODB.Command") Dim sqlstr, result sqlstr = "InUser"; SQLStmt1.CommandText = sqlstr SQLStmt1.CommandType = adCmdStoredProc Set SQLStmt1.ActiveConnection = OBJdbConnection1 SQLStmt1.Parameters.Append(SQLStmt1.createParameter("Id",adInteger,adParamInput,50,Id)) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("UId", adInteger,adParamInput,50,Session("UId"))) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("ToUId",adInteger,adParamInput,50,Uid)) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("R_id",adInteger,adParamOutput,50,Id)) result = OBJdbConnection.Execute(sqlstr) id=SQLStmt1.Parameters("R_id").value response.write(id)%></form ></body></html> 没有显示错误或消息框 而不是呼叫sp 请帮助not showing error or messageboxand not calling spplease help推荐答案 ASP代码如下...ASP CODE is as below...<html><body><form > <% MsgBox "Hello, World!" on error resume next Set OBJdbConnection1 = Server.CreateObject("ADODB.Connection") OBJdbConnection1.ConnectionTimeout = Session("ConnectionTimeout") OBJdbConnection1.CommandTimeout = Session("CommandTimeout") OBJdbConnection1.Open Session("ConnectionString") dim Uid,Id Uid = 1'request.form("Uid") Id = 0'request.form("Id") Set SQLStmt1 = Server.CreateObject("ADODB.Command") Dim sqlstr, result sqlstr = "InUser"; SQLStmt1.CommandText = sqlstr SQLStmt1.CommandType = adCmdStoredProc Set SQLStmt1.ActiveConnection = OBJdbConnection1 SQLStmt1.Parameters.Append(SQLStmt1.createParameter("Id",adInteger,adParamInput,50,Id)) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("UId", adInteger,adParamInput,50,Session("UId"))) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("ToUId",adInteger,adParamInput,50,Uid)) SQLStmt1.Parameters.Append(SQLStmt1.createParameter("R_id",adInteger,adParamOutput,50,Id)) result = OBJdbConnection.Execute(sqlstr) id=SQLStmt1.Parameters("R_id").value response.write(id)%></form ></body></html> 没有显示错误或消息框 而不是打电话给 请帮忙not showing error or messageboxand not calling spplease help 这篇关于具有输入输出参数的CORE ASP调用存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-22 18:48