Calling Mysql SP from ASP creates error

302
April 04, 2017, at 12:57 PM

When I tried calling a MySql stored proc from classic ASP, I get this error:

OUT or INOUT argument 5 for routine spAddContactUsEmail is not a variable or NEW pseudo-variable in BEFORE trigger

Here is the SP (which I can call successfully from Mysql workbench):

CREATE DEFINER=`root`@`localhost` PROCEDURE `spAddContactUsEmail`(
    In vcName varchar(50),
    In vcPhone varchar(50),
    In vcEmail varchar(50),
    In txtComments text,
    Out intNewID int
)
BEGIN
    Insert Into contact_us (`Name`, Phone, Email, Comments, DateCreated) 
    Values (vcName, vcPhone, vcEmail, txtComments, now());
    Set intNewID = Last_Insert_ID();
END

Here is the ASP code:

Dim con
Dim cmd
Set con = Server.CreateObject("ADODB.Connection")
con.Open "connection string" 
Set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection = con
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "spAddContactUsEmail"
cmd.Parameters.Append cmd.CreateParameter("vcName", adVarChar, adParamInput, 50, "John Doe")
cmd.Parameters.Append cmd.CreateParameter("vcPhone", adVarChar, adParamInput, 50, "333-4444")
cmd.Parameters.Append cmd.CreateParameter("vcEmail", adVarChar, adParamInput, 50, "test@yahoo.com")
cmd.Parameters.Append cmd.CreateParameter("txtComments", adLongVarChar, adParamInput, Len("hey"), "hey")
cmd.Parameters.Append cmd.CreateParameter("intNewID", adInteger, adParamReturnValue)
cmd.Execute

The error occurs on the cmd.Execute line. Thanks in advance.

Rent Charter Buses Company
READ ALSO
Hosting server manegment

Hosting server manegment

Hello guys I uploaded my final project to a hosting server and I have a problemI'm using angular, web API & SQL Microsoft server

250
how to structure the data in tables format?

how to structure the data in tables format?

I have the following data indat format which i opened in excel and it turns out this way

264
Multiple subqueries with inner join

Multiple subqueries with inner join

My sql query results in multiple result

301
i don't understand what is happening here can someone help me out to understand what i am doing wrong

i don't understand what is happening here can someone help me out to understand what i am doing wrong

here is the base64 encoded smilies generated form my android phone and saved into mysql when i try to display it in browser first i need to check if the string is base64 encoded then i decoded and print it, but below code fails to

232