I have the following Store Procedure
in my MySQL database, SP_Autentica
:
BEGIN
SET @id = (SELECT ID FROM userdata WHERE Username = user AND Password = pass);
END
In ASP code, conn.asp
:
connectstr = "Driver={MySQL ODBC 3.51 Driver};SERVER=" & db_server & ";PORT=" & db_port & ";DATABASE=" & db_name & ";UID=" & db_username & ";PWD=" & db_userpassword & ";OPTION=" & db_option
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open connectstr
In ASP code, CheckUser.asp
:
<!-- #include file="../assets/commonFiles/conn.asp" -->
varUsername = Request("Username")
varPassword = Request("Password")
cmd = Server.CreateObject("ADODB.Command")
cmd.CommandText = SP_Autentica
cmd.CommandType = 4
p = cmd.Parameters
p.Append(cmd.CreateParameter("@user","@pass"))
cmd("@user") = varUsername
cmd("@pass") = varPassword
cmd.ActiveConnection = Conn
cmd.Execute()
I would like to receive the response of this SELECT
of Procedure
in a variable, when the user sends the parameters of user
and pass
. But I get the following error message:
Microsoft VBScript runtime error '800a01b6' Object does not support this property or method: 'cmd.CommandText' /login/CheckUserSP.asp, line 55
Can anyone help me?