Re: Help on Connector for MySQL Server 5.1 and VB6
Posted by:
Bags Cruz
Date: August 22, 2013 06:30AM
I have managed to solve this problem. But I have encountered the same issue in the 3.51 connect. the error message is as follows:
[MySQL][ODBC 5.2(w) Driver][mysqld-5.1.38-community]OUT or INOUT argument 2 for routine DBname.StoredProc1 is not a variable or NEW pseudo-variable in BEFORE trigger
My VB6 codes are as follows:
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "add_category"
cmd.Parameters.Append cmd.CreateParameter("cat", adVarChar, adParamInput, 25, txtCategoryDesc.Text)
cmd.Parameters.Append cmd.CreateParameter("recs", adInteger, adParamOutput)
cmd.Execute
num = cmd.Parameters("recs")
And my sql stored proc script are as follows:
CREATE DEFINER=`root`@`localhost` PROCEDURE `StoredProc1`( IN cat VARCHAR(25), OUT recs INT)
BEGIN
SET recs = 0;
SELECT COUNT(*) INTO recs FROM TableName1 WHERE Field1 = cat;
IF (recs = 0) THEN
INSERT INTO TableName1 (Field1) VALUES (cat);
END IF;
END$$
DELIMITER ;
I hope you guys can help me.
Thanks!! =D
Subject
Written By
Posted
Re: Help on Connector for MySQL Server 5.1 and VB6
August 22, 2013 06:30AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.