Hey All,
I was wondering if someone could try and help me out, i have been at my wits end the last few days trying to get this to work and it just keeps returning mismatch errors.
Basically what i want to do is construct a IF ELSE statement with values that i have dynamically grabbed from a database and also values that are hard coded into the script, below is the code:
Code:
CheckSub1="Chris Rates for 12 months"
CheckSub2="Bob Rates for 6 months"
Dim ssGetRows
Dim S, O
Set ssGetRows = Server.CreateObject("ADODB.Recordset")
ssGetRows.Open "rates", dbGlobal
If ssGetRows.BOF and ssGetRows.EOF Then
S = " Then"
Else
ssGetRows.MoveFirst
While Not ssGetRows.EOF
S = " cItem.Description = " & ssGetRows("name") & " rates for 6 months OR cItem.Description = " & ssGetRows("name") & " rates for 12 months "
ssGetRows.MoveNext
If ssGetRows.EOF then
Else
O = "OR"
End If
S = S & O
wEnd
End If
if cItem.Description = CheckSub1 OR cItem = CheckSub2 OR S then
'Do something
else
'Do something else
end if
When i do run this, i get a
Type Mismatch: '[string: " cItem.Descripti"]'
on the line that has the if statement.
Please someone help me, i just cant seem to get it going, im desperate.
Thanks