Why Is My Boolean Not Being Assigned The Correct Value?
I've got this ASP.Net code:
Solution 1:
Once I used the "debug msg" code from MCND and moved the database code above the "Save Action" it works just fine. Here it is in a little context:
<%
. . .
'determine whether this unit is a new business
currentYear = Year(Now)
SQLString = "Select NewBiz from MasterUnitsprojSales where CYear = " & currentYear & " and Unit = '" & Unit & "'"
adoRS = New ADODB.Recordset
adoRS.Open(SQLString, adoCon)
IsNewBusiness = TRUE 'default (if record not found)
If Not adoRS.EOF Then
IsNewBusiness = adoRS.Fields.Item(0).Value <> 0
Response.Write("<!-- IsNewBusiness after NOT EOF = " & CStr(IsNewBusiness) & "-->")
End If
adoRS.Close()
If Request.Form.Item("Action") = "Save" Then
. . .
Post a Comment for "Why Is My Boolean Not Being Assigned The Correct Value?"