Thanks for your reply.
In fact, Not the return value is lost, but the constants I assign.
In my case below, ucApple is no longer equal to "0" and ucOrange is no
longer "1" after executing stored procedure. The return value is actually
"0", but 0 (Return_Value) is not equal to "Null" (ucApple), so it doesn't
work. But if I try
Select Case CInt(Return_Value)
Case 0 : Response.Write "An apple value was returned."
Case 1 : Response.Write "An orange value was returned."
Case Else : Response.Write "No worthwhile value was returned."
End Select
It works. I'm confusing...
Neo
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:uq**************@TK2MSFTNGP10.phx.gbl...
Where's Return_Value coming from (post the code). There isn't any reason
that your values would be lost. Your code below should work fine for
values of 0 and 1 (not 3 though...). I'd suggest using a select case structure
for this, but you can worry about that after you figure out why Return_Value
does not have a value.
Select Case CInt(Return_Value)
Case adInteger : Response.Write "AdInteger value was returned."
Case ucApple : Response.Write "An apple value was returned."
Case ucOrange : Response.Write "An orange value was returned."
Case Else : Response.Write "No worthwhile value was returned."
End Select
Ray at home
--
Will trade ASP help for SQL Server help
"Neo Chou" <ne*****@hotmail.com> wrote in message
news:ON**************@TK2MSFTNGP10.phx.gbl... Greetings!
I have a question about constant.
I have a page like:
----------------------------------------------------------------------
<%
Const adInteger = 3 'copied from adovbs.inc
Const ucApple = 0 'user defined constant
Const ucOrange = 1 'user defined constant
%>
<%
Dim Return_Value
' execute a stored procedure and get the return value
' the return value can only be either 0 or 1
%>
<table>
<tr><td>
<%
If Return_Value = ucApple Then
Response.Write "Apple"
ElseIf Return_Value = ucOrange Then
Response.Write "Orange"
Else
Response.Write "Nothing"
End If
%>
</td></tr>
</table>
-----------------------------------------------------------------------
It prints "Nothing" all the time no matter the stored procedure returns
0 or 1. If I replace "ucApple" with 0 and "ucOrange" with 1, the output is
correct. I believe the user defined constants are lost. But I can use
"adInteger" when I call the stored procedure to create parameters. Why?
Am I doing wrong?
Thanks in advance.
Neo