-
Invalid procedure call or argument: 'Left'
Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Left' at the line:
strInList = Left(strInList, len(strInList)-1)
any ideas?
Dim arrCuisines, strInList
arrCuisines = array("AFRICAN","CARIBBEAN","CHINESE","CONTINENTAL ",....")
For each cuisine In arrCuisines
If Request.Form(cuisine) = "true" Then
strInList = strInList & "'" & cuisine & "',"
End If
Next
strInList = Left(strInList, len(strInList)-1)
sql = "SELECT * FROM logbook WHERE cusine IN (" & strInList & ")"
-
This can happen if strInList is 0 characters in length...
If Len(strInList) > 1) Then
strInList = Left(strInList, len(strInList)-1)
End if
Idealy, I would check for physical location...
Mypos = InStrRev(strInList, ",")
If MyPos > 0 Then
strInList = Left(strInList, MyPos-len(strInList))
sql = "SELECT * FROM logbook WHERE cusine IN (" & strInList & ")"
Else 'There is no selection
sql = "SELECT * FROM logbook"
End If
You could look at using Trim to remove any unwanted spaces...
Dim MyVar
MyVar = LTrim(" vbscript ") ' MyVar contains "vbscript ".
MyVar = RTrim(" vbscript ") ' MyVar contains " vbscript".
MyVar = Trim(" vbscript ") ' MyVar contains "vbscript".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks