Hi all. I've been struggling with this all morning and would really appreciate help. I return the value of company_ind to a recordset from a sql server database. Company_ind can = null, spaces or have an alphanumeric value. If the value of company_ind = spaces or is null, I want to assign E1, E2, E3 or E4 to authNav depending on what the value of sAuthCode is. If there is a value in company_ind other than spaces or null then I want to assign H1, H2, H3 or H4 to authNav depending on what the value of sAuthCode is.
Test case problems:
Company_ind is null in the db and when I response.write its value on the asp page it correctly displays 'company_ind = '. The sAuthCode = 1. Therefore the value of authNav s/b H1 but its assigning E1. Same thing happens when sAuthCode = 3: it assigns E3 but should be H3. If company_id = the string "acs" and sAuthCode = 1 then the correct value of authNave E1 is assigned.
My problem is how I'm evaluating the value of company_ind on the asp page. Thanks in advance for any help.
I've also tried <> "", not null and can't get anything to work.
Here's the scripting:
Dim authNav
If company_ind > "" Then
If sAuthCode = 1 Then
authNav = "E1"
ElseIf sAuthCode = 2 Then
authNav = "E2"
ElseIf sAuthCode = 3 Then
authNav = "E3"
ElseIf sAuthCode = 4 Then
authNav = "E4"
End If
Else
If sAuthCode = 1 Then
authNav = "H1"
ElseIf sAuthCode = 2 Then
authNav = "H2"
ElseIf sAuthCode = 3 Then
authNav = "H3"
ElseIf sAuthCode = 4 Then
authNav = "H4"
End If
End If
Response.Write("authNav = " & authNav & "<br>")
Select Case authNav
Case "E1"
do something
Case "E2"
do something
ETC
End Select
Test case problems:
Company_ind is null in the db and when I response.write its value on the asp page it correctly displays 'company_ind = '. The sAuthCode = 1. Therefore the value of authNav s/b H1 but its assigning E1. Same thing happens when sAuthCode = 3: it assigns E3 but should be H3. If company_id = the string "acs" and sAuthCode = 1 then the correct value of authNave E1 is assigned.
My problem is how I'm evaluating the value of company_ind on the asp page. Thanks in advance for any help.
I've also tried <> "", not null and can't get anything to work.
Here's the scripting:
Dim authNav
If company_ind > "" Then
If sAuthCode = 1 Then
authNav = "E1"
ElseIf sAuthCode = 2 Then
authNav = "E2"
ElseIf sAuthCode = 3 Then
authNav = "E3"
ElseIf sAuthCode = 4 Then
authNav = "E4"
End If
Else
If sAuthCode = 1 Then
authNav = "H1"
ElseIf sAuthCode = 2 Then
authNav = "H2"
ElseIf sAuthCode = 3 Then
authNav = "H3"
ElseIf sAuthCode = 4 Then
authNav = "H4"
End If
End If
Response.Write("authNav = " & authNav & "<br>")
Select Case authNav
Case "E1"
do something
Case "E2"
do something
ETC
End Select