Hi all,
I am trying to use stored procedure with asp, I need to pass in two parameters (username and password), and retrieve results into a recordset. Here is what I have so far:
Set cnnStoredProc = Server.CreateObject("ADODB.Connection")
cnnStoredProc.Open "Provider=SQLOLEDB;Data Source=localhost;" _
& "Initial Catalog=catalog name;User Id=uName;Password=pWord;"
' Create Command object we'll use to execute the SP
Set cmdStoredProc = Server.CreateObject("ADODB.Command")
' Set our Command to use our existing connection
cmdStoredProc.ActiveConnection = cnnStoredProc
cmdStoredProc.CommandText = "sp_MEMBERLOGIN"
cmdStoredProc.CommandType = adCmdStoredProc
cmdStoredProc.Parameters.Append cmdStoredProc.CreateParameter("USERNAME", adVarChar, adParamInput, 20, "fhabtezion")
cmdStoredProc.Parameters.Append cmdStoredProc.CreateParameter("PASSWORD", adVarChar, adParamInput, 20, "fhabtezion")
Set rs = cmdStoredProc.Execute
While not rs.eof
Response.Write(rs("firstname"))
End while
Set cmdStoredProc = Nothing
|
However, I keep receiving the following error:
| ADODB.Parameters error '800a0e7c' Parameter object is improperly defined. Inconsistent or incomplete information was provided. |
Any help with this is appreciated, thanks in advance.
Fidel