hkucsis
03-29-2004, 04:40 AM
Hi,
I have a function that performs login by calling a stored procedure. I want it to return "NULL" if there is error in the stored procedure, return a recordset if no error.
<%
function Login()
...
Set myRecordset = cmd.Execute(...)
If (There is Error in stored proc) Then 'check output parameter of the stored proc
Set Login = Nothing
Else
Set Login = myRecordset
End If
End function
set rsLoginResult = Login()
If Not (IsNull(rsLoginResult)) Then 'Problem here: always is not null
If Not rsLoginResult.EOF then
Response.Write "Logged in"
Else
Response.Write "Failed"
End If
Else
Response.Write "Error in stored procedure"
end if
%>
But rsLoginResult always is NOT null. How to achieve what I want?
Many thanks.
Michael
I have a function that performs login by calling a stored procedure. I want it to return "NULL" if there is error in the stored procedure, return a recordset if no error.
<%
function Login()
...
Set myRecordset = cmd.Execute(...)
If (There is Error in stored proc) Then 'check output parameter of the stored proc
Set Login = Nothing
Else
Set Login = myRecordset
End If
End function
set rsLoginResult = Login()
If Not (IsNull(rsLoginResult)) Then 'Problem here: always is not null
If Not rsLoginResult.EOF then
Response.Write "Logged in"
Else
Response.Write "Failed"
End If
Else
Response.Write "Error in stored procedure"
end if
%>
But rsLoginResult always is NOT null. How to achieve what I want?
Many thanks.
Michael