Click here to Skip to main content
15,892,737 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is mysql routine(store procedure)...
SQL
-- --------------------------------------------------------------------------------
-- 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
)
BEGIN
	IF Id = 0 THEN     
		insert into test.main
		select (SELECT COALESCE(max(test.main.Id),0)+1 FROM test.main) as id,UId as uid;

		insert into test.main
		select (SELECT max(test.main.Id) FROM test.main) as id,UIdTo as uid;  
		
		set R_Id = (select max(id) from test.main);
	Else
		insert into test.main
		select test.main.Id as id,UIdTo as uid; 

		set R_Id = (select max(test.main.id) from test.main);
	End If;
END



ASP CODE is as below...
XML
<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 messagebox
and not calling sp

please help
Posted
Updated 20-Jan-13 19:45pm
v2
Comments
Om Prakash Pant 21-Jan-13 3:58am    
remove "on error resume next" to see the actual error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900