Nicodemas
09-25-2003, 05:26 AM
I have a value that is assigned to a variable called intAlternateID. The value that is assigned is the value that was submitted from the form on the same page. However, in the beginning of the page, I have a test condition that asks if the variable is null or not so as to inform the page to process an update statement or not.
When I use:
If Not IsNull(intAlternateID) Then ...
...
End If
The statement executes, even though the form was never submitted! Instead, it is assigning the variable a hard space as a value.
Why?
Sample code:
Dim intTopUnit, intPOC, intAlternateID, intSubUnit
intTopUnit = Request.Querystring("topunit") '// The group ID that the alternate will maintain.
intPOC = Request.Querystring("poc") '// The ID number of the alternate.
intAlternateID = Request("intAlternateID") '// The ID number of the alternate passed through the form below.
intSubUnit = Request("select_subunit") '// The ID number of the subunit the users submits through the form below.
'//-------------------------------------------------------------------
'//
'// Why does the logic insert a blank space into intAlternateID?
'//
'// For the time being, allow the code to execute backwards.
'//
'//-------------------------------------------------------------------
If Not IsNull(intAlternateID) Then
strSQL = "UPDATE tblAlternate SET intSubAlternateGroup = "& intSubUnit &" WHERE intPOC = "& intAlternateID &" AND intGroupLabel = "& intTopUnit
ysnSuccess = adlExecuteSQL(strDB,strSQL,NULL)
If ysnSuccess = TRUE Then
Response.Write "<H3>You may close this window</H3>"
End If
End If
When I use:
If Not IsNull(intAlternateID) Then ...
...
End If
The statement executes, even though the form was never submitted! Instead, it is assigning the variable a hard space as a value.
Why?
Sample code:
Dim intTopUnit, intPOC, intAlternateID, intSubUnit
intTopUnit = Request.Querystring("topunit") '// The group ID that the alternate will maintain.
intPOC = Request.Querystring("poc") '// The ID number of the alternate.
intAlternateID = Request("intAlternateID") '// The ID number of the alternate passed through the form below.
intSubUnit = Request("select_subunit") '// The ID number of the subunit the users submits through the form below.
'//-------------------------------------------------------------------
'//
'// Why does the logic insert a blank space into intAlternateID?
'//
'// For the time being, allow the code to execute backwards.
'//
'//-------------------------------------------------------------------
If Not IsNull(intAlternateID) Then
strSQL = "UPDATE tblAlternate SET intSubAlternateGroup = "& intSubUnit &" WHERE intPOC = "& intAlternateID &" AND intGroupLabel = "& intTopUnit
ysnSuccess = adlExecuteSQL(strDB,strSQL,NULL)
If ysnSuccess = TRUE Then
Response.Write "<H3>You may close this window</H3>"
End If
End If