In the following code currentregion = 'BC'
and Regions = 'ABC'
.
I am trying to find the currentregion
in the Regions
and normally it should hit else
as the if
condition is false
.
But it returns true
as InStr
searches part of the string not string vs string. So BC being part of ABC it enters the if loop.
Is there a function in Classic ASP that I can compare a string to string but not part of the string like InStr function.
RegionSQL = "SELECT * FROM Regions Where Auth <= " & Session("U_Auth") & ";"
Set rsRegion=Server.CreateObject("recordset")
rsRegion.Open RegionSQL,TheDB
If NOT rsRegion.EOF And NOT rsRegion.BOF Then
rsRegion.MoveFirst
While Not rsRegion.Eof
'Grab Current Region
currentregion = rsRegion("RegionCodeShort")
If InStr(Regions,currentregion) > 0 Then
checked = "checked"
Else
checked = ""
End If