I'm trying to call a Stored Procedure from a classic ASP application and I'm getting a 3709 error being thrown. This is a connection could not be... error.
On Error Resume Next
set ConnectionStr = "driver=SQL Server;server=***;uid=***;pwd=***;database=***"
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
Set .ActiveConnection = ConnectionStr
.CommandType = adCmdStoredProc
.CommandText = "storedprocedure"
'Input Parameters
.Parameters.Append .CreateParameter("@email", adVarchar, adParamInput, 50, Request.Form("email"))
.Parameters.Append .CreateParameter("@pass", adVarchar, adParamInput, 50, Request.Form("password"))
End With
set rs = Server.CreateObject("ADODB.RecordSet")
'rs.Open cmd.Execute
set rs = cmd.Execute 'Here is 3709 Error
If not rs.eof Then 'I get a 3704 Error here because of the 3709 error above
'Do Things with the RS
End If
Set cmd = Nothing
My Stored Procedure is:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[nameofprocedure]
@email nvarchar(50),
@pass nvarchar(50)
AS
BEGIN
SET NOCOUNT ON
SELECT is, fstname, lstname, [password]
FROM users
WHERE email = @email AND [password] = @pass;
RETURN
END